MCPcopy
hub / github.com/cortesi/devd / ReverseProxy

Struct ReverseProxy

reverseproxy/reverseproxy.go:31–49  ·  view source on GitHub ↗

ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.

Source from the content-addressed store, hash-verified

29// sends it to another server, proxying the response back to the
30// client.
31type ReverseProxy struct {
32 // Director must be a function which modifies
33 // the request into a new request to be sent
34 // using Transport. Its response is then copied
35 // back to the original client unmodified.
36 Director func(*http.Request)
37
38 // The transport used to perform proxy requests.
39 // If nil, http.DefaultTransport is used.
40 Transport http.RoundTripper
41
42 // FlushInterval specifies the flush interval
43 // to flush to the client while copying the
44 // response body.
45 // If zero, no periodic flushing is done.
46 FlushInterval time.Duration
47
48 Inject inject.CopyInject
49}
50
51func singleJoiningSlash(a, b string) string {
52 if b == "" {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected