Documentation ¶
Index ¶
- Variables
- func ListenAndServe(config ServerConfig) error
- type Browser
- type Server
- func (ws *Server) GetCert(info *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (ws *Server) Resolve(ctx context.Context, name string) (context.Context, net.IP, error)
- func (ws *Server) Rewrite(ctx context.Context, request *socks.Request) (context.Context, *socks.AddrSpec)
- func (ws *Server) ServeHTTP(writer http.ResponseWriter, req *http.Request)
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownBrowserKind = fmt.Errorf("supported browser kinds are: 'chromium'")
ErrUnknownBrowserKind indicates use of an unknown/unsupported browser family name
Functions ¶
func ListenAndServe ¶
func ListenAndServe(config ServerConfig) error
ListenAndServe creates/runs a miniweb server until an error interrupts it
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser is a launch structure for viewing proxied miniweb resource in a Web browser
func NewBrowser ¶
NewBrowser constructs a Browser for a given kind/exe path and with a given SOCKS5 port on localhost
type Server ¶
type Server struct { // Public information Config ServerConfig // Config is the initial configuration (ports, paths) used to initialize the server // contains filtered or unexported fields }
Server encapsulates the inner state of a running miniweb server (ports, filesystem root, configurations, caches, etc.)
func (*Server) GetCert ¶
func (ws *Server) GetCert(info *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCert retrieves the TLS cert to use for a particular DNS name from the miniweb file tree/configuration
type ServerConfig ¶
type ServerConfig struct { HTTPPort int // HTTPPort is the TCP port (on localhost, exclusively) from which we will serve redirected HTTP requests HTTPSPort int // HTTPSPort is like HTTPPort but for redirected TLS connections SOCKS5Addr string // SOCKS5Port is the TCP endpoint at which we will accept SOCKS5 requests to resolve/redirect DNS names and HTTP[S] requests DataRoot string // Full path to miniweb data store (top level directory names == DNS names, contents == HTTP[S] document root tree) }
ServerConfig defines the operating parameters of a miniweb server: TCP ports to bind and filesystem root
Click to show internal directories.
Click to hide internal directories.