socks5

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Version = 5

Version is socks5 version number

Variables

This section is empty.

Functions

func NewSocks5Dialer

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

NewSocks5Dialer returns a socks5 proxy dialer

func NewSocks5Server

func NewSocks5Server(s string, dialer proxy.Dialer) (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

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

SOCKS5 struct

func NewSOCKS5

func NewSOCKS5(s string, dialer proxy.Dialer) (*SOCKS5, error)

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

func (*SOCKS5) Addr

func (s *SOCKS5) Addr() string

Addr returns forwarder's address

func (*SOCKS5) Dial

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

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

func (s *SOCKS5) ListenAndServe()

ListenAndServe serves socks5 requests

func (*SOCKS5) ListenAndServeTCP

func (s *SOCKS5) ListenAndServeTCP()

ListenAndServeTCP .

func (*SOCKS5) ListenAndServeUDP

func (s *SOCKS5) ListenAndServeUDP()

ListenAndServeUDP serves udp requests

func (*SOCKS5) NextDialer

func (s *SOCKS5) NextDialer(dstAddr string) proxy.Dialer

NextDialer returns the next dialer

func (*SOCKS5) Serve added in v0.6.9

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

Serve .

Jump to

Keyboard shortcuts

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