test

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientMessage = "hello from client"
	ServerMessage = "hello from server"

	Success = iota
	FailedProxySetup
	FailedRequest
	DefaultChunkSize = 0xF
)

Variables

View Source
var (
	SampleMessage = []byte("HELLO")
	SampleAddress = &net.TCPAddr{
		IP:   net.ParseIP("127.0.0.1"),
		Port: 9999,
	}
)

Functions

func GetRequestContents

func GetRequestContents(url string) []byte

func GetRequestHTTP

func GetRequestHTTP(targetUrl, username, password string) uint8

func GetRequestRaw

func GetRequestRaw(url string) uint

func GetRequestSocks5

func GetRequestSocks5(url, username, password string) uint8

func GetRequestToPool

func GetRequestToPool() int

func NewBindHandler

func NewBindHandler(handler proxy2.HTTPHandler, filters listeners.Filters) net.Listener

func NewBindPipe

func NewBindPipe(protocol proxy2.Protocol, filters listeners.Filters) net.Listener

func NewHTTPServers

func NewHTTPServers(t *testing.T) (net.Listener, net.Listener)

func NewMasterSlave

func NewMasterSlave(protocol proxy2.Protocol, filters listeners.Filters) (net.Listener, net.Listener)

func NewMasterSlaveHandler

func NewMasterSlaveHandler(handler proxy2.HTTPHandler, filters listeners.Filters) (net.Listener, net.Listener)

func Socks6BindSucceed

func Socks6BindSucceed(
	proxyAddress string,
	authMethod proxy2.AuthenticationMethod,
	filters listeners.Filters,
	username, password string,
	t *testing.T,
)

func StartIPv4HTTPServer

func StartIPv4HTTPServer(t *testing.T) net.Listener

func StartIPv6HTTPServer

func StartIPv6HTTPServer(t *testing.T) net.Listener

Types

type BasicAccept

type BasicAccept struct{}

func (*BasicAccept) Accept

func (b *BasicAccept) Accept(address string) error

func (*BasicAccept) Inbound

func (b *BasicAccept) Inbound(address string) error

func (*BasicAccept) Listen

func (b *BasicAccept) Listen(address string) error

func (*BasicAccept) Outbound

func (b *BasicAccept) Outbound(address string) error

type BasicInbound

type BasicInbound struct{}

func (*BasicInbound) Accept

func (b *BasicInbound) Accept(address string) error

func (*BasicInbound) Inbound

func (b *BasicInbound) Inbound(address string) error

func (*BasicInbound) Listen

func (b *BasicInbound) Listen(address string) error

func (*BasicInbound) Outbound

func (b *BasicInbound) Outbound(address string) error

type BasicListen

type BasicListen struct{}

func (*BasicListen) Accept

func (b *BasicListen) Accept(address string) error

func (*BasicListen) Inbound

func (b *BasicListen) Inbound(address string) error

func (*BasicListen) Listen

func (b *BasicListen) Listen(address string) error

func (*BasicListen) Outbound

func (b *BasicListen) Outbound(address string) error

type BasicOutbound

type BasicOutbound struct{}

func (*BasicOutbound) Accept

func (b *BasicOutbound) Accept(address string) error

func (*BasicOutbound) Inbound

func (b *BasicOutbound) Inbound(address string) error

func (*BasicOutbound) Listen

func (b *BasicOutbound) Listen(address string) error

func (*BasicOutbound) Outbound

func (b *BasicOutbound) Outbound(address string) error

Jump to

Keyboard shortcuts

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