MCPcopy
hub / github.com/golang/net / TestFromURL

Function TestFromURL

proxy/proxy_test.go:78–97  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestFromURL(t *testing.T) {
79 ss, err := sockstest.NewServer(sockstest.NoAuthRequired, sockstest.NoProxyRequired)
80 if err != nil {
81 t.Fatal(err)
82 }
83 defer ss.Close()
84 url, err := url.Parse("socks5://user:password@" + ss.Addr().String())
85 if err != nil {
86 t.Fatal(err)
87 }
88 proxy, err := FromURL(url, nil)
89 if err != nil {
90 t.Fatal(err)
91 }
92 c, err := proxy.Dial("tcp", "fqdn.doesnotexist:5963")
93 if err != nil {
94 t.Fatal(err)
95 }
96 c.Close()
97}
98
99func TestSOCKS5(t *testing.T) {
100 ss, err := sockstest.NewServer(sockstest.NoAuthRequired, sockstest.NoProxyRequired)

Callers

nothing calls this directly

Calls 8

CloseMethod · 0.95
AddrMethod · 0.95
NewServerFunction · 0.92
FromURLFunction · 0.85
StringMethod · 0.65
DialMethod · 0.65
CloseMethod · 0.65
ParseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…