4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-10 21:12:30 +00:00
Files
.github
bridge
gateway
hook
matterclient
matterhook
vendor
github.com
BurntSushi
GeertJohan
Sirupsen
alecthomas
bwmarrin
daaku
dgrijalva
facebookgo
go-telegram-bot-api
google
gorilla
jpillora
kardianos
labstack
matrix-org
mattermost
mattn
mreiferson
mrexodia
nicksnyder
nlopes
slack
examples
LICENSE
admin.go
attachments.go
backoff.go
bots.go
channels.go
chat.go
comment.go
conversation.go
dnd.go
emoji.go
files.go
groups.go
history.go
im.go
info.go
item.go
messageID.go
messages.go
misc.go
oauth.go
pagination.go
pins.go
reactions.go
rtm.go
search.go
slack.go
stars.go
team.go
users.go
websocket.go
websocket_channels.go
websocket_dm.go
websocket_dnd.go
websocket_files.go
websocket_groups.go
websocket_internals.go
websocket_managed_conn.go
websocket_misc.go
websocket_pins.go
websocket_proxy.go
websocket_reactions.go
websocket_stars.go
websocket_teams.go
websocket_utils.go
pborman
peterhellberg
russross
shurcooL
sorcix
sromku
technoweenie
thoj
tylerb
valyala
zfjagann
golang.org
gopkg.in
manifest
Dockerfile
LICENSE
README-0.6.md
README.md
changelog.md
matterbridge.go
matterbridge.toml.sample
matterbridge.toml.simple
migration.md
matterbridge/vendor/github.com/nlopes/slack/websocket_utils.go
2016-09-05 16:34:37 +02:00

21 lines
426 B
Go

package slack
import (
"net"
"net/url"
)
var portMapping = map[string]string{"ws": "80", "wss": "443"}
func websocketizeURLPort(orig string) (string, error) {
urlObj, err := url.ParseRequestURI(orig)
if err != nil {
return "", err
}
_, _, err = net.SplitHostPort(urlObj.Host)
if err != nil {
return urlObj.Scheme + "://" + urlObj.Host + ":" + portMapping[urlObj.Scheme] + urlObj.Path, nil
}
return orig, nil
}