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: 0

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