socks5

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2021 License: GPL-3.0 Imports: 12 Imported by: 11

Documentation

Overview

Package socks5 implements a socks5 proxy.

Index

Constants

View Source
const Version = 5

Version is socks5 version number.

Variables

This section is empty.

Functions

func NewSocks5Dialer

func NewSocks5Dialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewSocks5Dialer returns a socks5 proxy dialer.

func NewSocks5Server

func NewSocks5Server(s string, p proxy.Proxy) (proxy.Server, error)

NewSocks5Server returns a socks5 proxy server.

Types

type PktConn

type PktConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

PktConn .

func NewPktConn

func NewPktConn(c net.PacketConn, writeAddr net.Addr, tgtAddr socks.Addr, tgtHeader bool, ctrlConn net.Conn) *PktConn

NewPktConn returns a PktConn.

func (*PktConn) Close

func (pc *PktConn) Close() error

Close .

func (*PktConn) ReadFrom

func (pc *PktConn) ReadFrom(b []byte) (int, net.Addr, error)

ReadFrom overrides the original function from net.PacketConn.

func (*PktConn) WriteTo

func (pc *PktConn) WriteTo(b []byte, addr net.Addr) (int, error)

WriteTo overrides the original function from net.PacketConn.

type Socks5 added in v0.8.1

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

Socks5 is a base socks5 struct.

func NewSocks5 added in v0.8.1

func NewSocks5(s string, d proxy.Dialer, p proxy.Proxy) (*Socks5, error)

NewSocks5 returns a Proxy that makes SOCKS v5 connections to the given address. with an optional username and password. (RFC 1928)

func (*Socks5) Addr added in v0.8.1

func (s *Socks5) Addr() string

Addr returns forwarder's address.

func (*Socks5) Dial added in v0.8.1

func (s *Socks5) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net via the SOCKS5 proxy.

func (*Socks5) DialUDP added in v0.8.1

func (s *Socks5) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error)

DialUDP connects to the given address via the proxy.

func (*Socks5) ListenAndServe added in v0.8.1

func (s *Socks5) ListenAndServe()

ListenAndServe serves socks5 requests.

func (*Socks5) ListenAndServeTCP added in v0.8.1

func (s *Socks5) ListenAndServeTCP()

ListenAndServeTCP listen and serve on tcp port.

func (*Socks5) ListenAndServeUDP added in v0.8.1

func (s *Socks5) ListenAndServeUDP()

ListenAndServeUDP serves udp requests.

func (*Socks5) Serve added in v0.8.1

func (s *Socks5) Serve(c net.Conn)

Serve serves a connection.

Jump to

Keyboard shortcuts

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