proxy

package
v0.0.0-...-83b6606 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProxyKindListener        ProxyKind = "listener"
	ProxyKindDialer                    = "dialer"
	ProxyKindReadWriteCloser           = "readwritecloser"
)

Variables

View Source
var (
	ErrProxyNotSupported   = errors.New("operation not supported")
	ErrProxyBusy           = errors.New("proxy is busy")
	ErrProxyNotInitialized = errors.New("proxy is not initialized")
	ErrNotImplemented      = errors.New("method not implemented")
)
View Source
var Registry = ProxyRegistry{/* contains filtered or unexported fields */}

Functions

This section is empty.

Types

type BaseConn

type BaseConn struct {
	LocalAddress  *ProxyAddr
	RemoteAddress *ProxyAddr
}

func (*BaseConn) Close

func (c *BaseConn) Close() error

func (*BaseConn) LocalAddr

func (c *BaseConn) LocalAddr() net.Addr

func (*BaseConn) Read

func (c *BaseConn) Read(b []byte) (int, error)

func (*BaseConn) RemoteAddr

func (c *BaseConn) RemoteAddr() net.Addr

func (*BaseConn) SetDeadline

func (c *BaseConn) SetDeadline(t time.Time) error

func (*BaseConn) SetReadDeadline

func (c *BaseConn) SetReadDeadline(t time.Time) error

func (*BaseConn) SetWriteDeadline

func (c *BaseConn) SetWriteDeadline(t time.Time) error

func (*BaseConn) Write

func (c *BaseConn) Write(b []byte) (int, error)

type Proxy

type Proxy struct {
	Listener ProxyListener
	Dialer   ProxyDialer
	Conn     net.Conn
}

func CreateProxyFromConn

func CreateProxyFromConn(conn net.Conn) *Proxy

func CreateProxyFromDialer

func CreateProxyFromDialer(d ProxyDialer) *Proxy

func CreateProxyFromListener

func CreateProxyFromListener(ln ProxyListener) *Proxy

func (*Proxy) Connect

func (p *Proxy) Connect() (net.Conn, error)

func (*Proxy) Kind

func (p *Proxy) Kind() ProxyKind

type ProxyAddr

type ProxyAddr struct {
	url.URL
}

func ParseAddr

func ParseAddr(raw string) (*ProxyAddr, error)

func (*ProxyAddr) Network

func (a *ProxyAddr) Network() string

func (*ProxyAddr) ProxyScheme

func (a *ProxyAddr) ProxyScheme() ProxyScheme

func (*ProxyAddr) String

func (a *ProxyAddr) String() string

type ProxyDialer

type ProxyDialer interface {
	Dial() (net.Conn, error)
}

type ProxyEntryPoint

type ProxyEntryPoint struct {
	Create    func(addr *ProxyAddr) (*Proxy, error)
	Scheme    ProxyScheme
	ShortHelp string
	Help      string
}

type ProxyKind

type ProxyKind string

type ProxyListener

type ProxyListener interface {
	IsListening() bool
	Listen() error
	Accept() (net.Conn, error)
}

type ProxyRegistry

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

func (*ProxyRegistry) Add

func (r *ProxyRegistry) Add(ep ProxyEntryPoint)

func (*ProxyRegistry) Create

func (r *ProxyRegistry) Create(addr *ProxyAddr) (*Proxy, error)

func (ProxyRegistry) Get

func (ProxyRegistry) Keys

func (r ProxyRegistry) Keys() []ProxyScheme

func (ProxyRegistry) Values

func (r ProxyRegistry) Values() []ProxyEntryPoint

type ProxyScheme

type ProxyScheme string

func (ProxyScheme) IsListener

func (s ProxyScheme) IsListener() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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