Documentation ¶
Index ¶
- Constants
- Variables
- func ClientHandshake(conn net.Conn, key [KeyLength]byte, destination M.Socksaddr, payload []byte) error
- func ClientHandshakeBuffer(conn net.Conn, key [KeyLength]byte, destination M.Socksaddr, ...) error
- func ClientHandshakePacket(conn net.Conn, key [KeyLength]byte, destination M.Socksaddr, ...) error
- func ClientHandshakeRaw(conn net.Conn, key [KeyLength]byte, command byte, destination M.Socksaddr, ...) error
- func HandleMuxConnection(ctx context.Context, conn net.Conn, metadata M.Metadata, handler Handler, ...) error
- func Key(password string) [KeyLength]byte
- func ReadPacket(conn net.Conn, buffer *buf.Buffer) (M.Socksaddr, error)
- func WritePacket(conn net.Conn, buffer *buf.Buffer, destination M.Socksaddr) error
- type ClientConn
- type ClientPacketConn
- func (c *ClientPacketConn) FrontHeadroom() int
- func (c *ClientPacketConn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
- func (c *ClientPacketConn) NeedHandshake() bool
- func (c *ClientPacketConn) Read(p []byte) (n int, err error)
- func (c *ClientPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *ClientPacketConn) ReadPacket(buffer *buf.Buffer) (M.Socksaddr, error)
- func (c *ClientPacketConn) Upstream() any
- func (c *ClientPacketConn) WaitReadPacket() (buffer *buf.Buffer, destination M.Socksaddr, err error)
- func (c *ClientPacketConn) Write(p []byte) (n int, err error)
- func (c *ClientPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error
- func (c *ClientPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
- type Handler
- type PacketConn
- func (c *PacketConn) FrontHeadroom() int
- func (c *PacketConn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
- func (c *PacketConn) NeedAdditionalReadDeadline() bool
- func (c *PacketConn) ReadPacket(buffer *buf.Buffer) (M.Socksaddr, error)
- func (c *PacketConn) Upstream() any
- func (c *PacketConn) WaitReadPacket() (buffer *buf.Buffer, destination M.Socksaddr, err error)
- func (c *PacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error
- type Service
Constants ¶
View Source
const ( KeyLength = 56 CommandTCP = 1 CommandUDP = 3 CommandMux = 0x7f )
Variables ¶
View Source
var CRLF = []byte{'\r', '\n'}
View Source
var ErrUserExists = E.New("user already exists")
Functions ¶
func ClientHandshake ¶
func ClientHandshakeBuffer ¶
func ClientHandshakePacket ¶
func ClientHandshakeRaw ¶
func HandleMuxConnection ¶
Types ¶
type ClientConn ¶
type ClientConn struct { N.ExtendedConn // contains filtered or unexported fields }
func NewClientConn ¶
func (*ClientConn) FrontHeadroom ¶
func (c *ClientConn) FrontHeadroom() int
func (*ClientConn) NeedHandshake ¶ added in v1.2.0
func (c *ClientConn) NeedHandshake() bool
func (*ClientConn) Upstream ¶
func (c *ClientConn) Upstream() any
func (*ClientConn) WriteBuffer ¶
func (c *ClientConn) WriteBuffer(buffer *buf.Buffer) error
type ClientPacketConn ¶
func NewClientPacketConn ¶
func NewClientPacketConn(conn net.Conn, key [KeyLength]byte) *ClientPacketConn
func (*ClientPacketConn) FrontHeadroom ¶
func (c *ClientPacketConn) FrontHeadroom() int
func (*ClientPacketConn) InitializeReadWaiter ¶ added in v1.8.0
func (c *ClientPacketConn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
func (*ClientPacketConn) NeedHandshake ¶ added in v1.2.0
func (c *ClientPacketConn) NeedHandshake() bool
func (*ClientPacketConn) ReadPacket ¶
func (*ClientPacketConn) Upstream ¶
func (c *ClientPacketConn) Upstream() any
func (*ClientPacketConn) WaitReadPacket ¶ added in v1.8.0
func (*ClientPacketConn) WritePacket ¶
type Handler ¶
type Handler interface { N.TCPConnectionHandler N.UDPConnectionHandler }
type PacketConn ¶
func (*PacketConn) FrontHeadroom ¶
func (c *PacketConn) FrontHeadroom() int
func (*PacketConn) InitializeReadWaiter ¶ added in v1.8.0
func (c *PacketConn) InitializeReadWaiter(options N.ReadWaitOptions) (needCopy bool)
func (*PacketConn) NeedAdditionalReadDeadline ¶ added in v1.2.5
func (c *PacketConn) NeedAdditionalReadDeadline() bool
func (*PacketConn) ReadPacket ¶
func (*PacketConn) Upstream ¶ added in v1.2.5
func (c *PacketConn) Upstream() any
func (*PacketConn) WaitReadPacket ¶ added in v1.8.0
func (*PacketConn) WritePacket ¶
type Service ¶
type Service[K comparable] struct { // contains filtered or unexported fields }
func NewService ¶
func NewService[K comparable](handler Handler, fallbackHandler N.TCPConnectionHandler, logger logger.ContextLogger) *Service[K]
func (*Service[K]) NewConnection ¶
func (*Service[K]) UpdateUsers ¶
Click to show internal directories.
Click to hide internal directories.