socks

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: GPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Connect   tunnel.Command = 1
	Associate tunnel.Command = 3
)
View Source
const (
	MaxPacketSize = 1024 * 8
)
View Source
const Name = "SOCKS"

Variables

This section is empty.

Functions

func NewServer

func NewServer(ctx context.Context, underlay tunnel.Server) (tunnel.Server, error)

NewServer create a socks server

Types

type Client

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

type Config

type Config struct {
	LocalHost  string `json:"local_addr" yaml:"local-addr"`
	LocalPort  int    `json:"local_port" yaml:"local-port"`
	UDPTimeout int    `json:"udp_timeout" yaml:"udp-timeout"`
}

type Conn

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

func (*Conn) Metadata

func (c *Conn) Metadata() *tunnel.Metadata

type PacketConn

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

func NewPacketConn

func NewPacketConn(packet net.PacketConn, timeout time.Duration) *PacketConn

func (*PacketConn) Close

func (c *PacketConn) Close() error

func (*PacketConn) ReadWithMetadata

func (c *PacketConn) ReadWithMetadata(payload []byte) (int, *tunnel.Metadata, error)

func (*PacketConn) WriteWithMetadata

func (c *PacketConn) WriteWithMetadata(payload []byte, metadata *tunnel.Metadata) (int, error)

type Server

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

Server is a socks5 server

func (*Server) AcceptConn

func (s *Server) AcceptConn(tunnel.Tunnel) (tunnel.Conn, error)

func (*Server) AcceptPacket

func (s *Server) AcceptPacket(tunnel.Tunnel) (tunnel.PacketConn, error)

func (*Server) Close

func (s *Server) Close() error

type Tunnel

type Tunnel struct{}

func (*Tunnel) Name

func (*Tunnel) Name() string

func (*Tunnel) NewClient

func (*Tunnel) NewServer

func (*Tunnel) NewServer(ctx context.Context, server tunnel.Server) (tunnel.Server, error)

Jump to

Keyboard shortcuts

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