anyproxy

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 12 Imported by: 4

README

anyproxy

Proxy server supporting http/socks4/socks5/shadowsocks on port

Build Status Go Report Card GoDoc GitHub license gocover.io

This project is to add protocol support for the Bridge, or it can be used alone

Usage

API Documentation

Example

License

Licensed under the MIT License. See LICENSE for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNetClosing = errors.New("use of closed network connection")

Functions

func Register added in v0.4.0

func Register(scheme string, fun SchemeFunc)

Types

type AnyProxy

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

func NewAnyProxy

func NewAnyProxy(ctx context.Context, addrs []string, dial Dialer, logger *log.Logger, pool BytesPool) (*AnyProxy, error)

func (*AnyProxy) Hosts added in v0.3.0

func (a *AnyProxy) Hosts() []string

func (*AnyProxy) ListenAndServe

func (a *AnyProxy) ListenAndServe(network, address string) error

func (*AnyProxy) Match added in v0.3.0

func (a *AnyProxy) Match(addr string) *Host

func (*AnyProxy) Run added in v0.3.1

func (a *AnyProxy) Run(ctx context.Context) error

type BytesPool added in v0.2.0

type BytesPool interface {
	Get() []byte
	Put([]byte)
}

BytesPool is an interface for getting and returning temporary bytes for use by io.CopyBuffer.

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type Host added in v0.3.0

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

func (*Host) ListenAndServe added in v0.3.0

func (h *Host) ListenAndServe(network, address string) error

func (*Host) ProxyURLs added in v0.3.0

func (h *Host) ProxyURLs() []string

func (*Host) ServeConn added in v0.3.0

func (h *Host) ServeConn(conn net.Conn)

type SchemeFunc added in v0.4.0

type SchemeFunc func(ctx context.Context, sch, address string, users []*url.Userinfo, dial Dialer, logger *log.Logger, pool BytesPool) (ServeConn, []string, error)

type ServeConn added in v0.4.0

type ServeConn interface {
	ServeConn(conn net.Conn)
}

func NewHttpServeConn added in v0.4.1

func NewHttpServeConn(s *http.Server) ServeConn

func NewServeConn added in v0.4.0

func NewServeConn(ctx context.Context, sch, address string, users []*url.Userinfo, dial Dialer, logger *log.Logger, pool BytesPool) (ServeConn, []string, error)

Directories

Path Synopsis
cmd
proxies

Jump to

Keyboard shortcuts

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