Documentation ¶
Overview ¶
Package chained provides a chained proxy that can proxy any tcp traffic over any underlying transport through a remote proxy. The downstream (client) side of the chained setup is just a dial function. The upstream (server) side is just an http.Handler. The client tells the server where to connect using an HTTP CONNECT request.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // DialServer: function that dials the upstream server proxy DialServer func() (net.Conn, error) // OnRequest: optional function that gets called on every CONNECT request to // the server and is allowed to modify the http.Request before it passes to // the server. OnRequest func(req *http.Request) // Label: a optional label for debugging. Label string }
Config is a configuration for a Dialer.
type Server ¶
type Server struct { // Dial: function for dialing destination Dial func(network, address string) (net.Conn, error) }
Server provides the upstream side of a chained proxy setup. It can be run as a standalone HTTP server using Serve() or plugged into an existing HTTP server as an http.Handler.
Click to show internal directories.
Click to hide internal directories.