adapters

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParserHTTPHostHeader

func ParserHTTPHostHeader(br *bufio.Reader) (method, host string)

ParserHTTPHostHeader returns the HTTP Host header from br without consuming any of its bytes. It returns "" if it can't find one.

Types

type HTTPAdapter

type HTTPAdapter struct {
	// contains filtered or unexported fields
}

HTTPAdapter is a adapter for HTTP connection

func NewHTTP

func NewHTTP(host string, peeked []byte, isHTTP bool, conn net.Conn) *HTTPAdapter

NewHTTP is HTTPAdapter generator

func (*HTTPAdapter) Addr

func (h *HTTPAdapter) Addr() *C.Addr

Addr return destination address

func (*HTTPAdapter) Close

func (h *HTTPAdapter) Close()

Close HTTP connection

func (*HTTPAdapter) Conn

func (h *HTTPAdapter) Conn() net.Conn

Conn return raw net.Conn of HTTP

type PeekedConn

type PeekedConn struct {
	net.Conn
	Peeked []byte
	// contains filtered or unexported fields
}

PeekedConn handle http connection and buffed HTTP data

func (*PeekedConn) Read

func (c *PeekedConn) Read(p []byte) (n int, err error)

type SocksAdapter

type SocksAdapter struct {
	// contains filtered or unexported fields
}

SocksAdapter is a adapter for socks and redir connection

func NewSocks

func NewSocks(target socks.Addr, conn net.Conn) *SocksAdapter

NewSocks is SocksAdapter generator

func (*SocksAdapter) Addr

func (s *SocksAdapter) Addr() *C.Addr

Addr return destination address

func (*SocksAdapter) Close

func (s *SocksAdapter) Close()

Close socks and redir connection

func (*SocksAdapter) Conn

func (s *SocksAdapter) Conn() net.Conn

Conn return raw net.Conn

Jump to

Keyboard shortcuts

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