Documentation
¶
Index ¶
- func JoinURLPath(req *protocol.Request, target string) (path []byte)
- func NewReverseProxy(target string, options ...Option) (szhttp.ReverseProxy, error)
- func NewReverseProxyDefault(target string) (szhttp.ReverseProxy, error)
- type Option
- func WithDebug() Option
- func WithDisablePathNormalizing(isDisablePathNormalizing bool) Option
- func WithDisableVirtualHost(isDisableVirtualHost bool) Option
- func WithMaxConnDuration(d time.Duration) Option
- func WithStreamResponseBody(size int) Option
- func WithTLS(certFile, keyFile string) (Option, error)
- func WithTLSConfig(config *tls.Config) Option
- func WithTimeout(d time.Duration) Option
- type ReverseProxy
- type WSReverseProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinURLPath ¶
nolint:funlen
func NewReverseProxy ¶
func NewReverseProxy(target string, options ...Option) (szhttp.ReverseProxy, error)
nolint
func NewReverseProxyDefault ¶
func NewReverseProxyDefault(target string) (szhttp.ReverseProxy, error)
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option to define all options to reverse http proxy.
func WithDisablePathNormalizing ¶
WithDisablePathNormalizing sets whether disable path normalizing.
func WithDisableVirtualHost ¶
WithDisableVirtualHost sets whether disable virtual host.
func WithMaxConnDuration ¶
WithMaxConnDuration sets maxConnDuration of hostClient, which means keep-alive connections are closed after this duration.
func WithStreamResponseBody ¶
WithStreamResponseBody sets whether stream response body or not.
func WithTLS ¶
WithTLS build tls.Config with server certFile and keyFile. tlsConfig is nil as default
func WithTLSConfig ¶
func WithTimeout ¶
WithTimeout specify the timeout of each request
type ReverseProxy ¶
type ReverseProxy struct {
// contains filtered or unexported fields
}
func (*ReverseProxy) Serve ¶
func (p *ReverseProxy) Serve(ctx szhttp.Context)
type WSReverseProxy ¶
type WSReverseProxy struct {
// contains filtered or unexported fields
}
func NewWSReverseProxy ¶
func NewWSReverseProxy(target string) (*WSReverseProxy, error)
func (*WSReverseProxy) Serve ¶
func (p *WSReverseProxy) Serve(ctx szhttp.Context)
Click to show internal directories.
Click to hide internal directories.