middleman

package
v0.0.0-...-42081d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type WhiteHTTP

type WhiteHTTP struct {
	Timeout  int
	Deadline int
}

WhiteHTTP is a HTTPMiddleman who only handles domain in white list

func NewWhiteHTTP

func NewWhiteHTTP(timeout, deadline int) *WhiteHTTP

NewWhiteHTTP returns a WhiteHTTP which can used to handle http proxy request

func (*WhiteHTTP) Handle

func (w *WhiteHTTP) 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

type WhiteSocks5

type WhiteSocks5 struct {
	Handle *socks5.DefaultHandle
}

WhiteSocks5 is a Socks5Middleman who only handles domain in white list

func NewWhiteSocks5

func NewWhiteSocks5() *WhiteSocks5

NewWhiteSocks5 returns a WhiteSocks5 which can be used to handle http proxy request

func (*WhiteSocks5) TCPHandle

func (w *WhiteSocks5) TCPHandle(s *socks5.Server, c *net.TCPConn, r *socks5.Request) (bool, error)

TCPHandle handles tcp request

func (*WhiteSocks5) UDPHandle

func (w *WhiteSocks5) UDPHandle(s *socks5.Server, ca *net.UDPAddr, d *socks5.Datagram) (bool, error)

UDPHandle handles udp packet

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL