MCPcopy Create free account
hub / github.com/bepass-org/proxy / writeAddrWithStr

Function writeAddrWithStr

pkg/socks5/common.go:275–284  ·  view source on GitHub ↗
(w io.Writer, addr string)

Source from the content-addressed store, hash-verified

273}
274
275func writeAddrWithStr(w io.Writer, addr string) error {
276 host, port, err := splitHostPort(addr)
277 if err != nil {
278 return err
279 }
280 if ip := net.ParseIP(host); ip != nil {
281 return writeAddr(w, &address{IP: ip, Port: port})
282 }
283 return writeAddr(w, &address{Name: host, Port: port})
284}
285
286func splitHostPort(address string) (string, int, error) {
287 host, port, err := net.SplitHostPort(address)

Callers 2

embedHandleAssociateMethod · 0.85
WriteMethod · 0.85

Calls 2

splitHostPortFunction · 0.85
writeAddrFunction · 0.70

Tested by

no test coverage detected