MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / getHTTPClient

Method getHTTPClient

pkg/controller/rtctrl/runtime.go:418–432  ·  view source on GitHub ↗

TODO: Add a timer to recreate the client ?

()

Source from the content-addressed store, hash-verified

416
417// TODO: Add a timer to recreate the client ?
418func (info *RuntimeInfo) getHTTPClient() *http.Client {
419 sock := fmt.Sprintf("/var/run/faas/%s", info.RuntimeID)
420 client := &http.Client{
421 Transport: &http.Transport{
422 DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
423 return net.Dial("unix", fmt.Sprintf("%s/%s", sock, RuntimeHTTPSock))
424 },
425 },
426 // forbid redirect
427 CheckRedirect: func(req *http.Request, via []*http.Request) error {
428 return http.ErrUseLastResponse
429 },
430 }
431 return client
432}

Callers 1

sendRequestLoopMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected