MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / pickHTTPClient

Method pickHTTPClient

internal/carrier/client.go:921–927  ·  view source on GitHub ↗

pickHTTPClient returns the next HTTP client in round-robin order. Each client has a distinct SNI host and connection pool, so successive calls naturally spread requests across separate throttle buckets.

()

Source from the content-addressed store, hash-verified

919// client has a distinct SNI host and connection pool, so successive calls
920// naturally spread requests across separate throttle buckets.
921func (c *Client) pickHTTPClient() *http.Client {
922 if len(c.httpClients) == 1 {
923 return c.httpClients[0]
924 }
925 idx := c.nextHTTP.Add(1) - 1
926 return c.httpClients[idx%uint64(len(c.httpClients))]
927}
928
929// pickRelayEndpoint picks the next non-blacklisted endpoint in round-robin
930// order. The per-bucket in-flight semaphore is enforced separately by

Callers 4

DiagnoseMethod · 0.95
fetchScriptStatsMethod · 0.95
ShutdownMethod · 0.95
pollOnceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected