Documentation
¶
Index ¶
- Constants
- func AddrToString(a socks.Addr) string
- func GenerateDomainStubs(domain string) []string
- func PipeCommand(cmds ...*exec.Cmd) (output []byte, err error)
- func ReadShadowsocksHeader(r io.Reader) (bool, socks.Addr, error)
- func ReadUdpOverTcp(r io.Reader, buffer []byte) (int, error)
- func WriteUdpOverTcp(w io.Writer, buffer []byte) (int, error)
- type DNSServerInterface
- type LeakyBuffer
- type ProxyClientInterface
Constants ¶
View Source
const ( UDP_BUFFER_POOL_SIZE = 1024 * 10 UDP_BUFFER_SIZE = 1024 * 4 DNS_BUFFER_POOL_SIZE = 1024 * 4 DNS_BUFFER_SIZE = 1024 * 2 UDP_OOB_POOL_SIZE = 512 UDP_OOB_BUFFER_SIZE = 1024 * 2 CHANNEL_QUEUE_LENGTH = 5 DOMAIN_BLACK_LIST = true DOMAIN_WHITE_LIST = false )
View Source
const ( AtTypeUdpIpv4 = 51 AtTypeUdpIpv6 = 52 )
Variables ¶
This section is empty.
Functions ¶
func AddrToString ¶
func GenerateDomainStubs ¶
Types ¶
type DNSServerInterface ¶
type LeakyBuffer ¶
type LeakyBuffer struct {
// contains filtered or unexported fields
}
func NewLeakyBuffer ¶
func NewLeakyBuffer(poolSize int, bufferSize int) (ret *LeakyBuffer)
func (*LeakyBuffer) Get ¶
func (c *LeakyBuffer) Get() []byte
func (*LeakyBuffer) GetBufferSize ¶
func (c *LeakyBuffer) GetBufferSize() int
func (*LeakyBuffer) Put ¶
func (c *LeakyBuffer) Put(buffer []byte)
type ProxyClientInterface ¶
type ProxyClientInterface interface { ExchangeDNS(dnsAddr string, data []byte, timeout time.Duration) (response *dns.Msg, err error) SetDNSProcessor(server DNSServerInterface) HandleUDP(buffer []byte, srcAddr *net.UDPAddr, dstAddr *net.UDPAddr, dataLen int) GetUDPBuffer() []byte PutUDPBuffer(buffer []byte) }
Click to show internal directories.
Click to hide internal directories.