socksproxy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: GPL-3.0, LGPL-2.1 Imports: 13 Imported by: 1 module, 1 package

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.

README

SOCKS Proxy

SOCKS4, SOCKS4A, SOCKS5 proxy server and client

Features

  • SOCKS4
  • SOCKS4A
  • SOCKS5
  • SOCKS5 with TLS

References

https://www.openssh.com/txt/socks4.protocol

https://www.openssh.com/txt/socks4a.protocol

https://tools.ietf.org/html/rfc1928

https://tools.ietf.org/html/rfc1929

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSOCKS

func IsSOCKS(r io.Reader) bool

func Serve

func Serve(listener net.Listener, conf *SOCKSConf)

Types

type Client

type Client interface {
	Dial(ctx context.Context, network, address string) (net.Conn, error)
}

func NewClient

func NewClient(proxy *url.URL, conf *SOCKSConf) (client Client, err error)

type SOCKSConf

type SOCKSConf struct {
	Auth        func(username, password string) bool
	Dial        func(ctx context.Context, network, address string) (net.Conn, error)
	HandleError func(error)
	TLSConfig   *tls.Config
}

type Socks4Client

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

func (*Socks4Client) Dial

func (c *Socks4Client) Dial(ctx context.Context, network, address string) (remoteConn net.Conn, err error)

type Socks5Client

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

func (*Socks5Client) Dial

func (c *Socks5Client) Dial(ctx context.Context, network, address string) (remoteConn net.Conn, err error)

Jump to

Keyboard shortcuts

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