MCPcopy
hub / github.com/txthinking/brook / GetAddressFromURL

Function GetAddressFromURL

util.go:41–50  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

39}
40
41func GetAddressFromURL(s string) (string, error) {
42 u, err := url.Parse(s)
43 if err != nil {
44 return "", err
45 }
46 if _, _, err := net.SplitHostPort(u.Host); err == nil {
47 return u.Host, nil
48 }
49 return net.JoinHostPort(u.Host, "80"), nil
50}
51
52func Conn2Conn(c, rc net.Conn, bufsize, timeout int) {
53 go func() {

Callers 1

HandleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected