|
|
|
@ -43,6 +43,7 @@ type HandlerOptions struct { |
|
|
|
TCPMode bool |
|
|
|
IPRoutes []IPRoute |
|
|
|
ProxyAgent string |
|
|
|
HTTPTunnel bool |
|
|
|
} |
|
|
|
|
|
|
|
// HandlerOption allows a common way to set handler options.
|
|
|
|
@ -219,6 +220,13 @@ func ProxyAgentHandlerOption(agent string) HandlerOption { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// HTTPTunnelHandlerOption sets the Tunnel mode for HTTP client used in HTTP handler.
|
|
|
|
func HTTPTunnelHandlerOption(tunnelMode bool) HandlerOption { |
|
|
|
return func(opts *HandlerOptions) { |
|
|
|
opts.HTTPTunnel = tunnelMode |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
type autoHandler struct { |
|
|
|
options *HandlerOptions |
|
|
|
} |
|
|
|
|