MCPcopy Create free account
hub / github.com/koding/kite / makeWebsocketURL

Function makeWebsocketURL

sockjsclient/sockjsclient.go:307–325  ·  view source on GitHub ↗
(u *url.URL, serverID, sessionID string)

Source from the content-addressed store, hash-verified

305}
306
307func makeWebsocketURL(u *url.URL, serverID, sessionID string) *url.URL {
308 if u.Scheme == "https" {
309 u.Scheme = "wss"
310 } else {
311 u.Scheme = "ws"
312 }
313
314 if _, _, err := net.SplitHostPort(u.Host); err != nil {
315 if u.Scheme == "wss" {
316 u.Host = net.JoinHostPort(u.Host, "443")
317 } else {
318 u.Host = net.JoinHostPort(u.Host, "80")
319 }
320 }
321
322 u.Path = path.Join(u.Path, serverID, sessionID, "websocket")
323
324 return u
325}

Callers 1

DialWebsocketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected