Documentation ¶
Index ¶
- type AddrAnfUser
- type Command
- type Server
- type 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 WithProxyDial(proxyDial statute.ProxyDialFunc) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrAnfUser ¶
type AddrAnfUser struct { Username string // contains filtered or unexported fields }
type Command ¶
type Command byte
Command is a SOCKS Command.
const (
ConnectCommand Command = 0x01
)
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 // UserConnectHandle gives the user control to handle the TCP CONNECT requests UserConnectHandle statute.UserConnectHandler // 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 SOCKS4 protocol
func NewServer ¶
func NewServer(options ...ServerOption) *Server
func (*Server) ListenAndServe ¶
type ServerOption ¶
type ServerOption func(*Server)
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 WithProxyDial ¶
func WithProxyDial(proxyDial statute.ProxyDialFunc) ServerOption
Click to show internal directories.
Click to hide internal directories.