MCPcopy
hub / github.com/lxc/incus / httpGetOverUnixSocket

Function httpGetOverUnixSocket

internal/server/endpoints/endpoints_test.go:64–72  ·  view source on GitHub ↗

Perform an HTTP GET "/" over the unix socket at the given path.

(path string)

Source from the content-addressed store, hash-verified

62
63// Perform an HTTP GET "/" over the unix socket at the given path.
64func httpGetOverUnixSocket(path string) error {
65 dial := func(_ context.Context, network, addr string) (net.Conn, error) {
66 return net.Dial("unix", path)
67 }
68
69 client := &http.Client{Transport: &http.Transport{DialContext: dial}}
70 _, err := client.Get("http://unix.socket/")
71 return err
72}
73
74// Perform an HTTP GET "/" over TLS, using the given network address and server
75// certificate.

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…