http

package
v0.0.0-...-9553153 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidService = errors.New("invalid service/version")
)

Common errors

Functions

func UnderlyingConn

func UnderlyingConn(conn net.Conn) net.Conn

UnderlyingConn returns underlying connection

Types

type Conn

type Conn struct {
	HostName string
	Peeked   []byte
	net.Conn
}

Conn ..

type DialProxy

type DialProxy struct {
	Addr            string
	KeepAlivePeriod time.Duration
	DialTimeout     time.Duration
	DialContext     func(ctx context.Context, network, address string) (net.Conn, error)
	OnDialError     func(src net.Conn, dstDialErr error)
}

DialProxy is target

func To

func To(addr string) *DialProxy

To ..

func (*DialProxy) HandleConn

func (dialproxy *DialProxy) HandleConn(ctx context.Context, src net.Conn)

HandleConn ..

type Matcher

type Matcher func(ctx context.Context, hostname string) bool

Matcher ..

type Proxy

type Proxy struct {
	ListenFunc func(net, laddr string) (net.Listener, error)
	// contains filtered or unexported fields
}

Proxy ..

func (*Proxy) AddRoute

func (proxy *Proxy) AddRoute(ipPort string, dest Target)

AddRoute ..

func (*Proxy) Close

func (proxy *Proxy) Close() error

Close closes all listeners

func (*Proxy) Start

func (proxy *Proxy) Start(ctx context.Context) error

Start ..

type Target

type Target interface {
	HandleConn(context.Context, net.Conn)
}

Target ..

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳