Help us shape the future of Go! Take the 2026 Go Developer Survey

proxyhz

package
v0.0.0-...-f1f9306 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinURLPath

func JoinURLPath(req *protocol.Request, target string) (path []byte)

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 WithDebug

func WithDebug() Option

func WithDisablePathNormalizing

func WithDisablePathNormalizing(isDisablePathNormalizing bool) Option

WithDisablePathNormalizing sets whether disable path normalizing.

func WithDisableVirtualHost

func WithDisableVirtualHost(isDisableVirtualHost bool) Option

WithDisableVirtualHost sets whether disable virtual host.

func WithMaxConnDuration

func WithMaxConnDuration(d time.Duration) Option

WithMaxConnDuration sets maxConnDuration of hostClient, which means keep-alive connections are closed after this duration.

func WithStreamResponseBody

func WithStreamResponseBody(size int) Option

WithStreamResponseBody sets whether stream response body or not.

func WithTLS

func WithTLS(certFile, keyFile string) (Option, error)

WithTLS build tls.Config with server certFile and keyFile. tlsConfig is nil as default

func WithTLSConfig

func WithTLSConfig(config *tls.Config) Option

func WithTimeout

func WithTimeout(d time.Duration) Option

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL