Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // TCP address to listen on Addr string // TCP address of target server Target string // ModifyRequest is an optional function that modifies the request from a client to the target server. ModifyRequest func(b *[]byte) // ModifyResponse is an optional function that modifies the response from the target server. ModifyResponse func(b *[]byte) // TLS configuration to listen on. TLSConfig *tls.Config // TLS configuration for the proxy if needed to connect to the target server with TLS protocol. // If nil, TCP protocol is used. TLSConfigTarget *tls.Config }
Server is a TCP server that takes an incoming request and sends it to another server, proxying the response back to the client.
func (*Server) ListenAndServe ¶
ListenAndServe listens on the TCP network address laddr and then handle packets on incoming connections.
func (*Server) ListenAndServeTLS ¶
ListenAndServeTLS acts identically to ListenAndServe, except that it uses TLS protocol. Additionally, files containing a certificate and matching private key for the server must be provided if neither the Server's TLSConfig.Certificates nor TLSConfig.GetCertificate are populated.
Click to show internal directories.
Click to hide internal directories.