Documentation ¶
Overview ¶
Package socks5 implements a socks5 proxy.
Index ¶
- Constants
- func NewSocks5Dialer(s string, d proxy.Dialer) (proxy.Dialer, error)
- func NewSocks5Server(s string, p proxy.Proxy) (proxy.Server, error)
- type PktConn
- type Session
- type Socks5
- func (s *Socks5) Addr() string
- func (s *Socks5) Dial(network, addr string) (net.Conn, error)
- func (s *Socks5) DialUDP(network, addr string) (pc net.PacketConn, err error)
- func (s *Socks5) ListenAndServe()
- func (s *Socks5) ListenAndServeTCP()
- func (s *Socks5) ListenAndServeUDP()
- func (s *Socks5) Serve(c net.Conn)
- func (s *Socks5) ServePacket(pc net.PacketConn)
Constants ¶
const Version = 5
Version is socks5 version number.
Variables ¶
This section is empty.
Functions ¶
func NewSocks5Dialer ¶
NewSocks5Dialer returns a socks5 proxy dialer.
Types ¶
type PktConn ¶
type PktConn struct { net.PacketConn // contains filtered or unexported fields }
PktConn .
func NewPktConn ¶
func NewPktConn(c net.PacketConn, writeAddr net.Addr, targetAddr socks.Addr, ctrlConn net.Conn) *PktConn
NewPktConn returns a PktConn, the writeAddr must be *net.UDPAddr or *net.UnixAddr.
type Session ¶ added in v0.15.0
type Session struct {
// contains filtered or unexported fields
}
Session is a udp session
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
NewSocks5 returns a Proxy that makes SOCKS v5 connections to the given address. with an optional username and password. (RFC 1928)
func (*Socks5) Dial ¶ added in v0.8.1
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, 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) ServePacket ¶ added in v0.16.0
func (s *Socks5) ServePacket(pc net.PacketConn)
ServePacket implementes proxy.PacketServer.