MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / inferServerURL

Function inferServerURL

internal/serverapi/node_enroll_token.go:132–149  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

130}
131
132func inferServerURL(r *http.Request) string {
133 scheme := "https"
134 if r.TLS == nil {
135 if proto := r.Header.Get("X-Forwarded-Proto"); proto != "" {
136 scheme = proto
137 } else {
138 scheme = "http"
139 }
140 }
141 host := r.Host
142 if fwd := r.Header.Get("X-Forwarded-Host"); fwd != "" {
143 host = fwd
144 }
145 if host == "" {
146 return ""
147 }
148 return scheme + "://" + host
149}
150
151func buildInstallCommand(serverURL, nodeID, token string) string {
152 return fmt.Sprintf("bash <(curl -fsSL %s) node --server=%s --node-id=%s --token=%s",

Callers 1

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected