Documentation ¶
Index ¶
- Variables
- type BlackWhite
- func (b *BlackWhite) Handle(method, addr string, request []byte, conn *net.TCPConn) (handled bool, err error)
- func (b *BlackWhite) Has(host string) bool
- func (b *BlackWhite) TCPHandle(s *socks5.Server, c *net.TCPConn, r *socks5.Request) (bool, error)
- func (b *BlackWhite) UDPHandle(s *socks5.Server, ca *net.UDPAddr, d *socks5.Datagram) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Dial ant.Dialer = ant.DefaultDial
Functions ¶
This section is empty.
Types ¶
type BlackWhite ¶
type BlackWhite struct { Mode string // mode is white or black Domains map[string]byte Nets []*net.IPNet Timeout int Deadline int Socks5Handle *socks5.DefaultHandle }
BlackWhite is a middleman
func NewBlackWhite ¶
func NewBlackWhite(mode, domainURL, cidrURL string, timeout, deadline int) (*BlackWhite, error)
NewBlackWhite returns a BlackWhite
func (*BlackWhite) Handle ¶
func (b *BlackWhite) Handle(method, addr string, request []byte, conn *net.TCPConn) (handled bool, err error)
Handle handles http proxy request, if the domain is in the white list
Click to show internal directories.
Click to hide internal directories.