anyproxy

package module
v0.7.18 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 12 Imported by: 4

README

anyproxy

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

Build Go Report Card GoDoc GitHub license gocover.io

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

The following is the implementation of other proxy protocols

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, conf *Config) (*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 Config added in v0.6.0

type Config struct {
	RawQueries   []string
	Users        []*url.Userinfo
	Dialer       Dialer
	ListenConfig ListenConfig
	Logger       Logger
	BytesPool    BytesPool
}

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) Serve added in v0.5.5

func (h *Host) Serve(listener net.Listener) error

func (*Host) ServeConn added in v0.3.0

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

type ListenConfig added in v0.6.0

type ListenConfig interface {
	Listen(ctx context.Context, network, address string) (net.Listener, error)
}

type Logger added in v0.5.0

type Logger interface {
	Println(v ...interface{})
}

type SchemeFunc added in v0.4.0

type SchemeFunc func(ctx context.Context, scheme string, address string, conf *Config) (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, scheme string, address string, conf *Config) (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