MCPcopy Create free account
hub / github.com/CPChain/chain / wsDialAddress

Function wsDialAddress

api/rpc/websocket.go:173–180  ·  view source on GitHub ↗
(location *url.URL)

Source from the content-addressed store, hash-verified

171var wsPortMap = map[string]string{"ws": "80", "wss": "443"}
172
173func wsDialAddress(location *url.URL) string {
174 if _, ok := wsPortMap[location.Scheme]; ok {
175 if _, _, err := net.SplitHostPort(location.Host); err != nil {
176 return net.JoinHostPort(location.Host, wsPortMap[location.Scheme])
177 }
178 }
179 return location.Host
180}
181
182func dialContext(ctx context.Context, network, addr string) (net.Conn, error) {
183 d := &net.Dialer{KeepAlive: tcpKeepAliveInterval}

Callers 1

wsDialContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected