Documentation
¶
Index ¶
- func SendReply(w io.Writer, rep uint8, bindAddr net.Addr) error
- type GPool
- type Logger
- type Option
- func WithAssociateHandle(h func(ctx context.Context, writer io.Writer, req *handler.Request) error) Option
- func WithAssociateMiddleware(m handler.Middleware) Option
- func WithAuthMethods(authMethods []auth.Authenticator) Option
- func WithBindAcceptTimeout(d time.Duration) Option
- func WithBindHandle(h func(ctx context.Context, writer io.Writer, req *handler.Request) error) Option
- func WithBindIP(ip net.IP) Option
- func WithBindMiddleware(m handler.Middleware) Option
- func WithBindPeerCheckIPOnly(b bool) Option
- func WithBufferPool(pool buffer.BufPool) Option
- func WithConnectHandle(h func(ctx context.Context, writer io.Writer, req *handler.Request) error) Option
- func WithConnectMiddleware(m handler.Middleware) Option
- func WithCredential(cs auth.CredentialStore) Option
- func WithDial(dial func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func WithDialAndRequest(...) Option
- func WithDialer(d net.Dialer) Option
- func WithGPool(pool GPool) Option
- func WithHandshakeTimeout(d time.Duration) Option
- func WithLogger(l Logger) Option
- func WithResolver(res resolver.NameResolver) Option
- func WithRewriter(rew handler.AddressRewriter) Option
- func WithRule(rule rules.RuleSet) Option
- func WithTCPKeepAlive(period time.Duration) Option
- func WithUDPAssociateLimits(maxPeers int, idleTimeout time.Duration) Option
- func WithUseBindIpBaseResolveAsUdpAddr(b bool) Option
- type Server
- type Std
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(s *Server)
func WithAssociateHandle ¶
func WithAssociateMiddleware ¶
func WithAssociateMiddleware(m handler.Middleware) Option
func WithAuthMethods ¶
func WithAuthMethods(authMethods []auth.Authenticator) Option
func WithBindAcceptTimeout ¶
func WithBindHandle ¶
func WithBindIP ¶
func WithBindMiddleware ¶
func WithBindMiddleware(m handler.Middleware) Option
func WithBindPeerCheckIPOnly ¶
func WithBufferPool ¶
func WithConnectHandle ¶
func WithConnectMiddleware ¶
func WithConnectMiddleware(m handler.Middleware) Option
func WithCredential ¶
func WithCredential(cs auth.CredentialStore) Option
func WithDialAndRequest ¶
func WithDialer ¶
WithDialer sets a custom net.Dialer for outbound connections when a custom dial is not provided.
func WithHandshakeTimeout ¶
WithHandshakeTimeout sets a deadline for initial negotiation and request parsing. Zero disables the handshake deadline.
func WithLogger ¶
func WithResolver ¶
func WithResolver(res resolver.NameResolver) Option
func WithRewriter ¶
func WithRewriter(rew handler.AddressRewriter) Option
func WithTCPKeepAlive ¶
WithTCPKeepAlive enables TCP keepalives on accepted connections with the given period. Zero disables keepalives.
func WithUDPAssociateLimits ¶
WithUDPAssociateLimits configures UDP ASSOCIATE peer limits and idle cleanup. If maxPeers <= 0, unlimited peers are allowed. If idleTimeout <= 0, peers are not GC'd by idle.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
func (*Server) ListenAndServeTLS ¶
Click to show internal directories.
Click to hide internal directories.