middleman

package
v0.0.0-...-6e90328 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*goproxy.ProxyHttpServer
	// contains filtered or unexported fields
}

Server is a middleman between client and real pxy server. It run as a https server which always eavesdrop https connections, the purpose is to reuse the connection between middleman and the pxy server, avoiding TLS handshakes for every request.

And, this is safe because the middleman server is usually deployed as a sidecar with crawler program together.

func NewServer

func NewServer(nb backend.NotifyBackend) *Server

type SessionManager

type SessionManager struct {
	// contains filtered or unexported fields
}

func NewSessionManager

func NewSessionManager(nb backend.NotifyBackend, strategy loadbalancer.Strategy) *SessionManager

func (*SessionManager) RoundTrip

func (sm *SessionManager) RoundTrip(req *http.Request, ctx *goproxy.ProxyCtx) (resp *http.Response, err error)

RoundTrip implements the goproxy.RoundTripper interface.

Jump to

Keyboard shortcuts

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