Documentation
¶
Overview ¶
Package socks5 a fully featured implementation of the SOCKS 5 protocol in golang.
Index ¶
- Variables
- func RemoteAddressFromContext(ctx context.Context) (net.Addr, bool)
- func UsernameFromContext(ctx context.Context) (string, bool)
- type Command
- type Driver
- type Logger
- type Metrics
- type Option
- func WithAllowCommands(commands ...Command) Option
- func WithBlockListHosts(hosts ...string) Option
- func WithDialTimeout(val time.Duration) Option
- func WithDriver(val Driver) Option
- func WithGetPasswordTimeout(val time.Duration) Option
- func WithHost(val string) Option
- func WithLogger(val Logger) Option
- func WithMaxPacketSize(val int) Option
- func WithMetrics(val Metrics) Option
- func WithNatCleanupPeriod(val time.Duration) Option
- func WithPacketWriteTimeout(val time.Duration) Option
- func WithPasswordAuthentication() Option
- func WithPort(val int) Option
- func WithPublicIP(val net.IP) Option
- func WithReadTimeout(val time.Duration) Option
- func WithRules(val Rules) Option
- func WithStaticCredentials(val map[string]string) Option
- func WithStore(val Store) Option
- func WithTTLPacket(val time.Duration) Option
- func WithWhiteListIPs(IPs ...net.IP) Option
- func WithWriteTimeout(val time.Duration) Option
- type Rules
- type Server
- type Store
Constants ¶
This section is empty.
Variables ¶
var NopLogger *nopLogger
Silent logger, produces no output
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
func WithAllowCommands ¶
func WithBlockListHosts ¶
func WithDialTimeout ¶
func WithDriver ¶
func WithGetPasswordTimeout ¶
func WithLogger ¶
func WithMaxPacketSize ¶
WithMaxPacketSize sets the maximum size in bytes for the datagram to be read from the socket.
func WithMetrics ¶
func WithNatCleanupPeriod ¶
WithNatCleanupPeriod sets the period when the table that links the packets from the sender to the remote host will be cleaned. It makes sense if there's no time limit on the TCP connection. TTL of the packet must be greater than 0.
func WithPacketWriteTimeout ¶
WithPacketWriteTimeout sets the timeout for waiting to write a packet to the remote host.
func WithPasswordAuthentication ¶
func WithPasswordAuthentication() Option
func WithPublicIP ¶
WithPublicIP sets an IP address that is visible on the external Internet, accessible to users outside the local network and will be sent to clients in response to a connection request.
func WithReadTimeout ¶
WithReadTimeout sets the read timeout for tcp connection.
func WithStaticCredentials ¶
func WithTTLPacket ¶
WithTTLPacket sets how long the packet will stay in the table that links the sender of the packet to the remote host it was meant for. Nat cleanup period must be greater than 0.
func WithWhiteListIPs ¶
func WithWriteTimeout ¶
WithWriteTimeout sets the write timeout for tcp connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}