Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DEBUG = false
DEBUG will print extra information to stdout
Functions ¶
func ListenAndServeTLSSNI ¶
func ListenAndServeTLSSNI(server *ServerWrapper, certs []Certificate) error
Types ¶
type Certificate ¶
type ReverseProxy ¶
type ReverseProxy struct { // Director must be a function which modifies // the request into a new request to be sent // using Transport. Its response is then copied // back to the original client unmodified. Director func(*http.Request) // The transport used to perform proxy requests. // If nil, http.DefaultTransport is used. Transport http.RoundTripper // FlushInterval specifies the flush interval // to flush to the client while copying the // response body. // If zero, no periodic flushing is done. FlushInterval time.Duration // ErrorLog specifies an optional logger for errors // that occur when attempting to proxy the request. // If nil, logging goes to os.Stderr via the log package's // standard logger. ErrorLog *log.Logger // Configure Websocket WsCFG WsConfig }
ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func NewSingleHostReverseProxy ¶
func NewSingleHostReverseProxy(target *url.URL, wsconfig WsConfig, flushInterval time.Duration) *ReverseProxy
NewSingleHostReverseProxy returns a new ReverseProxy that rewrites URLs to the scheme, host, and base path provided in target. If the target's path is "/base" and the incoming request was for "/dir", the target request will be for /base/dir.
func (*ReverseProxy) ServeHTTP ¶
func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
type ServerWrapper ¶
type ServerWrapper struct {
// contains filtered or unexported fields
}
func NewGracefulServer ¶
func NewGracefulServer(graceful *manners.GracefulServer) *ServerWrapper
func NewVanillaServer ¶
func NewVanillaServer(vanilla *http.Server) *ServerWrapper
func (*ServerWrapper) Close ¶
func (w *ServerWrapper) Close() bool
func (*ServerWrapper) GetAddr ¶
func (w *ServerWrapper) GetAddr() string
func (*ServerWrapper) GetTLSConfig ¶
func (w *ServerWrapper) GetTLSConfig() *tls.Config
func (*ServerWrapper) IsGraceful ¶
func (w *ServerWrapper) IsGraceful() bool
type WsConfig ¶
type WsConfig struct { Enabled bool `yaml:"enabled"` ReadBufferSize int `yaml:"read_buffer_size"` WriteBufferSize int `yaml:"write_buffer_size"` ReadDeadlineSeconds time.Duration `yaml:"read_deadline_seconds"` EnableCompression bool `yaml:"enable_compression"` }
WsConfig websockets configuration
Click to show internal directories.
Click to hide internal directories.