{"modulePath":"github.com/andrewbytecoder/nmq","version":"v0.0.0-20261028105650-d8b0a59c570e","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httputil\n\n## Constants\n\n```go\nconst (\n\t// StatusClientClosedRequest non-standard HTTP status code for client disconnection.\n\tStatusClientClosedRequest = 499\n\n\t// StatusClientClosedRequestText non-standard HTTP status for client disconnection.\n\tStatusClientClosedRequestText = \"Client Closed Request\"\n)\n```\n\n## Functions\n\n```go\nfunc ComputeStatusCode(err error) int\n```\nComputeStatusCode computes the HTTP status code according to the given error.\n\n```go\nfunc ErrorHandler(w http.ResponseWriter, req *http.Request, err error)\n```\nErrorHandler is the http.Handler called when something goes wrong when forwarding the request.\n\n```go\nfunc ErrorHandlerWithContext(ctx context.Context, w http.ResponseWriter, err error)\n```\nErrorHandlerWithContext is the http.Handler called when something goes wrong when forwarding the request.\n\n```go\nfunc JoinURLPath(a, b *url.URL) (path, rawpath string)\n```\nJoinURLPath computes the joined path and raw path of the given URLs. From [https://github.com/golang/go/blob/b521ebb55a9b26c8824b219376c7f91f7cda6ec2/src/net/http/httputil/reverseproxy.go#L221](https://github.com/golang/go/blob/b521ebb55a9b26c8824b219376c7f91f7cda6ec2/src/net/http/httputil/reverseproxy.go#L221)\n\n```go\nfunc SetNotAppendXFF(ctx context.Context) context.Context\n```\nSetNotAppendXFF indicates xff should not be appended.\n\n```go\nfunc ShouldNotAppendXFF(ctx context.Context) bool\n```\nShouldNotAppendXFF returns whether X-Forwarded-For should not be appended.\n\n## Types\n\n```go\ntype ProxyBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\nProxyBuilder handles the http.RoundTripper for httputil reverse proxies.\n\n```go\nfunc NewProxyBuilder(transportManager TransportManager) *ProxyBuilder\n```\nNewProxyBuilder creates a new ProxyBuilder.\n\n```go\nfunc (r *ProxyBuilder) Build(cfgName string, targetURL *url.URL, passHostHeader, preservePath bool, flushInterval time.Duration) (http.Handler, error)\n```\nBuild builds a new httputil.ReverseProxy with the given configuration.\n\n```go\nfunc (r *ProxyBuilder) Update(_ map[string]*dynamic.ServersTransport)\n```\nUpdate does nothing.\n\n```go\ntype TransportManager interface {\n\tGet(name string) (*dynamic.ServersTransport, error)\n\tGetRoundTripper(name string) (http.RoundTripper, error)\n\tGetTLSConfig(name string) (*tls.Config, error)\n}\n```\nTransportManager manages transport used for backend communications.\n\n","path":"github.com/andrewbytecoder/nmq/pkg/httputil","name":"httputil","synopsis":"","isRedistributable":true}
