func WithLogger(l Logger) Option {
	return func(s *Server) {
		s.logger = l
	}
}
WithLogger can be used to provide a custom log target.
Defaults to ioutil.Discard.
package socks5
import (
	"context"
	"io"
	"net"
	"github.com/things-go/go-socks5/bufferpool"
)
type Option func(s *Server)
func WithBufferPool(bufferPool bufferpool.BufPool) Option {
	return func(s *Server) {
		s.bufferPool = bufferPool
	}
}
func WithAuthMethods(authMethods []Authenticator) Option {
	return func(s *Server) {
		s.authMethods = append(s.authMethods, authMethods...)
	}
}
func WithCredential(cs CredentialStore) Option {
	return func(s *Server) {
		s.credentials = cs
	}
}
func WithResolver(res NameResolver) Option {
	return func(s *Server) {
		s.resolver = res
	}
}
func WithRule(rule RuleSet) Option {
	return func(s *Server) {
		s.rules = rule
	}
}
func WithRewriter(rew AddressRewriter) Option {
	return func(s *Server) {
		s.rewriter = rew
	}
}
func WithBindIP(ip net.IP) Option {
	return func(s *Server) {
		if len(ip) != 0 {
			s.bindIP = make(net.IP, 0, len(ip))
			s.bindIP = append(s.bindIP, ip...)
		}
	}
}