httpproxy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const RAND_SEQ_ID_LEN = 12

Variables

View Source
var Name string = "httpproxy"
View Source
var Version string = "unkown"

Functions

func CopyBuffer added in v0.4.3

func CopyBuffer(dst io.Writer, src io.Reader) (written int64, err error)

Copy copy with default buf

func NewTimeoutConn added in v0.4.3

func NewTimeoutConn(conn net.Conn, timeout time.Duration) *timeoutConn

NewTimeoutConn create timeout conn

func ShowVersion

func ShowVersion()

Types

type CloseWriter added in v1.0.0

type CloseWriter interface {
	CloseWrite() error
}

type HttpProxy added in v0.4.0

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

func NewHttpProxy added in v0.4.0

func NewHttpProxy(u *url.URL, d proxy.Dialer) (*HttpProxy, error)

func (*HttpProxy) Dial added in v0.4.0

func (hp *HttpProxy) Dial(network, addr string) (c net.Conn, err error)

type ProxyContextDialer added in v0.4.2

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

func NewProxyContextDialer added in v0.4.2

func NewProxyContextDialer(d proxy.Dialer) ProxyContextDialer

func (ProxyContextDialer) DialContext added in v0.4.2

func (d ProxyContextDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

*

  • from golang.org/x/net/proxy.dialContext

type Server

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

func NewServer

func NewServer(opts ...ServerOption) (*Server, error)

func (*Server) Listen added in v1.0.1

func (s *Server) Listen() (net.Listener, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Serve added in v0.3.0

func (s *Server) Serve(l net.Listener)

type ServerOption added in v0.4.2

type ServerOption interface {
	// contains filtered or unexported methods
}

func WithCertFile added in v1.0.1

func WithCertFile(certFile string) ServerOption

func WithConnectTimeout added in v0.4.2

func WithConnectTimeout(timeout time.Duration) ServerOption

func WithKeyFile added in v1.0.1

func WithKeyFile(keyFile string) ServerOption

func WithListenAddress added in v1.0.1

func WithListenAddress(listenAddress string) ServerOption

func WithListenPort added in v1.0.1

func WithListenPort(listenPort uint16) ServerOption

func WithPassword added in v1.0.0

func WithPassword(password string) ServerOption

func WithPretendAsWeb added in v1.0.3

func WithPretendAsWeb(pretendAsWeb bool) ServerOption

func WithProxy added in v0.4.2

func WithProxy(addr string) ServerOption

func WithTimeout added in v0.4.3

func WithTimeout(timeout time.Duration) ServerOption

func WithUsername added in v1.0.0

func WithUsername(username string) ServerOption

Jump to

Keyboard shortcuts

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