socks

package
v0.0.0-...-9ed9f2e Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version5 byte = 0x05
	Version4 byte = 0x04
)
View Source
const (
	Connect   byte = 0x01
	Associate byte = 0x03

	MaxPacketSize = 8 * 1024
)

Variables

This section is empty.

Functions

func HttpOnceAccept

func HttpOnceAccept(first byte, conn net.Conn) (addr *tunnel.Address, payload []byte, err error)

local socks server connect

Types

type Conn

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

func (*Conn) Hash

func (c *Conn) Hash() string

func (*Conn) Metadata

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

func (*Conn) Payload

func (c *Conn) Payload() []byte

type PacketConn

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

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, m *tunnel.Metadata) (int, error)

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string, ctx context.Context, log goproxy.Logger) (*Server, error)

func (*Server) AcceptConn

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

func (*Server) AcceptPacket

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

func (*Server) Close

func (s *Server) Close() error

func (*Server) Dial

func (s *Server) Dial(payload []byte, addr string) (conn net.Conn, err error)

Jump to

Keyboard shortcuts

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