socks5

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package socks5 is a minimal SOCKS5 server (RFC 1928): CONNECT only, no authentication. In userspace mode it is how local programs reach the mesh; the dial function decides where connections go.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnreachable = errors.New("destination not reachable through this proxy")

ErrUnreachable may be returned by a DialFunc for destinations it refuses to route; clients see "network unreachable".

Functions

This section is empty.

Types

type DialFunc

type DialFunc func(ctx context.Context, network, address string) (net.Conn, error)

DialFunc opens a connection to address ("host:port"), where host may be an IP address or a name.

type Server

type Server struct {
	Dial DialFunc
	Log  *slog.Logger
}

Server serves SOCKS5 clients.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, ln net.Listener) error

Serve accepts connections on ln until ctx is cancelled.

Jump to

Keyboard shortcuts

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