MCPcopy
hub / github.com/gorilla/websocket / Dial

Method Dial

x_net_proxy.go:323–339  ·  view source on GitHub ↗

Dial connects to the address addr on the given network via the SOCKS5 proxy.

(network, addr string)

Source from the content-addressed store, hash-verified

321
322// Dial connects to the address addr on the given network via the SOCKS5 proxy.
323func (s *proxy_socks5) Dial(network, addr string) (net.Conn, error) {
324 switch network {
325 case "tcp", "tcp6", "tcp4":
326 default:
327 return nil, errors.New("proxy: no support for SOCKS5 proxy connections of type " + network)
328 }
329
330 conn, err := s.forward.Dial(s.network, s.addr)
331 if err != nil {
332 return nil, err
333 }
334 if err := s.connect(conn, addr); err != nil {
335 conn.Close()
336 return nil, err
337 }
338 return conn, nil
339}
340
341// connect takes an existing connection to a socks5 proxy server,
342// and commands the server to extend that connection to target,

Callers

nothing calls this directly

Calls 3

connectMethod · 0.95
DialMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected