Documentation ¶
Index ¶
- Variables
- type CountryOnly
- func (b *CountryOnly) DNSHandle(s *socks5.Server, addr *net.UDPAddr, d *socks5.Datagram) (bool, error)
- func (b *CountryOnly) Handle(method, addr string, request []byte, conn *net.TCPConn) (handled bool, err error)
- func (b *CountryOnly) Has(host string) bool
- func (b *CountryOnly) TCPHandle(s *socks5.Server, c *net.TCPConn, r *socks5.Request) (bool, error)
- func (b *CountryOnly) UDPHandle(s *socks5.Server, ca *net.UDPAddr, d *socks5.Datagram) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Dial x.Dialer = x.DefaultDial
Functions ¶
This section is empty.
Types ¶
type CountryOnly ¶
type CountryOnly struct { Domains map[string]byte Nets []*net.IPNet Timeout int Deadline int Socks5Handle socks5.Handler InboundDNS string CountryDNS string }
CountryOnly is a middleman.
func NewCountryOnly ¶
func NewCountryOnly(domainURL, cidrURL, inboundDNS, countryDNS string, timeout, deadline int) (*CountryOnly, error)
NewCountryOnly returns a CountryOnly.
func (*CountryOnly) DNSHandle ¶
func (b *CountryOnly) DNSHandle(s *socks5.Server, addr *net.UDPAddr, d *socks5.Datagram) (bool, error)
DNSHandle handles DNS query.
func (*CountryOnly) Handle ¶
func (b *CountryOnly) 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.