proxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Relay

func Relay(a, b net.Conn, stats *RelayStats)

Relay copies data bidirectionally between a and b until one side closes or errors. Returns when both directions are done.

Types

type RelayStats

type RelayStats struct {
	BytesUp   atomic.Int64
	BytesDown atomic.Int64
}

type SOCKS5Server

type SOCKS5Server struct {
	SM       *tunnel.StreamManager
	Logger   *log.Logger
	Listener net.Listener

	ActiveConns atomic.Int64
	TotalConns  atomic.Int64
}

SOCKS5 server that listens locally and forwards connections through the tunnel via yamux streams. Runs on the client (PC) side.

func (*SOCKS5Server) ListenAndServe

func (s *SOCKS5Server) ListenAndServe(ctx context.Context, addr string) error

ListenAndServe binds to addr (e.g. "127.0.0.1:1080") and accepts SOCKS5 connections until ctx is done.

type Server

type Server struct {
	SM     *tunnel.StreamManager
	Logger *log.Logger

	ActiveConns atomic.Int64
	TotalConns  atomic.Int64
}

Server accepts yamux streams from the tunnel and dials the requested target on the open internet. Runs on the VPS side.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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