Documentation ¶
Index ¶
- type Command
- type Server
- type ServerOption
- func WithAssociateHandle(handler statute.UserAssociateHandler) ServerOption
- func WithBind(bindAddress string) ServerOption
- func WithBytesPool(bytesPool statute.BytesPool) ServerOption
- func WithConnectHandle(handler statute.UserConnectHandler) ServerOption
- func WithContext(ctx context.Context) ServerOption
- func WithLogger(logger *slog.Logger) ServerOption
- func WithPacketForwardAddress(packetForwardAddress statute.PacketForwardAddress) ServerOption
- func WithProxyDial(proxyDial statute.ProxyDialFunc) ServerOption
- func WithProxyListenPacket(proxyListenPacket statute.ProxyListenPacket) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // bind is the address to listen on Bind string Listener net.Listener // ProxyDial specifies the optional proxyDial function for // establishing the transport connection. ProxyDial statute.ProxyDialFunc // ProxyListenPacket specifies the optional proxyListenPacket function for // establishing the transport connection. ProxyListenPacket statute.ProxyListenPacket // PacketForwardAddress specifies the packet forwarding address PacketForwardAddress statute.PacketForwardAddress // UserConnectHandle gives the user control to handle the TCP CONNECT requests UserConnectHandle statute.UserConnectHandler // UserAssociateHandle gives the user control to handle the UDP ASSOCIATE requests UserAssociateHandle statute.UserAssociateHandler // Logger error log Logger *slog.Logger // Context is default context Context context.Context // BytesPool getting and returning temporary bytes for use by io.CopyBuffer BytesPool statute.BytesPool }
Server is accepting connections and handling the details of the SOCKS5 protocol
func NewServer ¶
func NewServer(options ...ServerOption) *Server
func (*Server) ListenAndServe ¶
type ServerOption ¶
type ServerOption func(*Server)
func WithAssociateHandle ¶
func WithAssociateHandle(handler statute.UserAssociateHandler) ServerOption
func WithBind ¶
func WithBind(bindAddress string) ServerOption
func WithBytesPool ¶
func WithBytesPool(bytesPool statute.BytesPool) ServerOption
func WithConnectHandle ¶
func WithConnectHandle(handler statute.UserConnectHandler) ServerOption
func WithContext ¶
func WithContext(ctx context.Context) ServerOption
func WithLogger ¶
func WithLogger(logger *slog.Logger) ServerOption
func WithPacketForwardAddress ¶
func WithPacketForwardAddress(packetForwardAddress statute.PacketForwardAddress) ServerOption
func WithProxyDial ¶
func WithProxyDial(proxyDial statute.ProxyDialFunc) ServerOption
func WithProxyListenPacket ¶
func WithProxyListenPacket(proxyListenPacket statute.ProxyListenPacket) ServerOption
Click to show internal directories.
Click to hide internal directories.