proxy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, network, address string, handler *ServerHandler) error

ListenAndServe listens on the network address and serves proxy requests.

func Serve

func Serve(ctx context.Context, listener net.Listener, handler *ServerHandler) error

Serve accepts incoming connections and dispatches based on protocol.

func ServeConn

func ServeConn(ctx context.Context, handler *ServerHandler, conn net.Conn) error

ServeConn handles a single client connection, including protocol detection and dispatching to the appropriate handler. If no handler is found the connection is closed.

Types

type ServerHandler

type ServerHandler struct {
	Socks4 socks4.ServerHandler
	Socks5 socks5.ServerHandler

	UnknownHandler func(conn net.Conn, peekedByte byte)
}

ServerHandler multiplexes incoming connections to the appropriate SOCKS4 or SOCKS5 handlers based on protocol detection.

Jump to

Keyboard shortcuts

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