anyproxy

package module
v0.0.0-...-5a9b937 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 12 Imported by: 0

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

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

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

func (*AnyProxy) ListenAndServe

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

func (*AnyProxy) Match

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

func (*AnyProxy) Run

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

type BytesPool

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

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

type Config

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

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

func (*Host) ListenAndServe

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

func (*Host) ProxyURLs

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

func (*Host) Serve

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

func (*Host) ServeConn

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

type ListenConfig

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

type Logger

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

type SchemeFunc

type SchemeFunc func(ctx context.Context, scheme string, address string, conf *Config) (ServeConn, []string, error)

type ServeConn

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

func NewHttpServeConn

func NewHttpServeConn(s *http.Server) ServeConn

func NewServeConn

func NewServeConn(ctx context.Context, scheme string, address string, conf *Config) (ServeConn, []string, error)

Directories

Path Synopsis
cmd
anyproxy command
proxies

Jump to

Keyboard shortcuts

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