socks

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

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 (*PacketConn) Close

func (c *PacketConn) Close() error

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*PacketConn) ReadWithMetadata

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

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

func (*PacketConn) WriteWithMetadata

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

type Server

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

func NewServer

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

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 (t *Tunnel) Name() string

func (*Tunnel) NewServer

func (t *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