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
- func (c *ClientConn) FrontHeadroom() int
- func (c *ClientConn) NeedHandshake() bool
- func (c *ClientConn) ReadFrom(r io.Reader) (n int64, err error)
- func (c *ClientConn) Upstream() any
- func (c *ClientConn) Write(p []byte) (n int, err error)
- func (c *ClientConn) WriteBuffer(buffer *buf.Buffer) error
- func (c *ClientConn) WriteTo(w io.Writer) (n int64, err error)
- type ClientPacketConn
- func (c *ClientPacketConn) FrontHeadroom() int
- 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) 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
- 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) NeedHandshake ¶ added in v1.2.0
func (c *ClientPacketConn) NeedHandshake() bool
func (*ClientPacketConn) ReadPacket ¶
func (*ClientPacketConn) Upstream ¶
func (c *ClientPacketConn) Upstream() any
func (*ClientPacketConn) WritePacket ¶
type Handler ¶
type Handler interface { N.TCPConnectionHandler N.UDPConnectionHandler E.Handler }
type PacketConn ¶
func (*PacketConn) FrontHeadroom ¶
func (c *PacketConn) FrontHeadroom() int
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) WritePacket ¶
type Service ¶
type Service[K comparable] struct { // contains filtered or unexported fields }
func NewService ¶
func NewService[K comparable](handler Handler, fallbackHandler N.TCPConnectionHandler) *Service[K]
func (*Service[K]) NewConnection ¶
func (*Service[K]) UpdateUsers ¶
Click to show internal directories.
Click to hide internal directories.