socks

package
v0.4.45 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package socks5 is a SOCKS5 server implementation.

This is used for userspace networking in Tailscale. Specifically, this is used for dialing out of the machine to other nodes, without the host kernel's involvement, so it doesn't proper routing tables, TUN, IPv6, etc. This package is meant to only handle the SOCKS5 protocol details and not any integration with Tailscale internals itself.

The glue between this package and Tailscale is in net/socks5/tssocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

func NewBackend

func NewBackend(cfg *BackendConfig) (*Backend, error)

func (*Backend) Run

func (b *Backend) Run() error

type BackendConfig

type BackendConfig struct {
	IdentityPath string
	ShrToken     string
	Requests     chan *endpoints.Request
}

type Conn

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

Conn is a SOCKS5 connection for client to reach server.

func (*Conn) Run

func (c *Conn) Run() error

Run starts the new connection.

type Server

type Server struct {
	// Dialer optionally specifies the dialer to use for outgoing connections.
	// If nil, the net package's standard dialer is used.
	Dialer func(ctx context.Context, network, addr string) (net.Conn, error)

	// Username and Password, if set, are the credential clients must provide.
	Username string
	Password string

	// For notifying user-facing components about activity
	Requests chan *endpoints.Request
}

Server is a SOCKS5 proxy server.

func (*Server) Serve

func (s *Server) Serve(l net.Listener) error

Serve accepts and handles incoming connections on the given listener.

Jump to

Keyboard shortcuts

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