go-tunnel/http_config.go

22 lines
438 B
Go
Raw Permalink Normal View History

2020-10-26 19:42:07 +01:00
package tunnel
import "net/http/httputil"
type ConfigureReverseProxyFunc func(*httputil.ReverseProxy) error
type ProxyConfig struct {
ConfigureReverseProxy ConfigureReverseProxyFunc
}
func DefaultProxyConfig() *ProxyConfig {
return &ProxyConfig{}
}
type ProxyConfigFunc func(c *ProxyConfig)
func WithProxyConfigure(fn ConfigureReverseProxyFunc) ProxyConfigFunc {
return func(c *ProxyConfig) {
c.ConfigureReverseProxy = fn
}
}