Documentation ¶
Index ¶
- Constants
- func TransferFromListen(lAddr *net.TCPAddr, keepListening bool, output *HttpTransferContext) error
- func TransferFromListenAddress(lAddress string, keepListening bool, output *HttpTransferContext) error
- func TransferHTTP(src net.Conn, closed bool) (chan iokit.Direction, error)
- func TransferTCPOrHTTP(src net.Conn, dst net.Conn, closed bool) (chan iokit.Direction, error)
- func TransferTCPOrHTTPDynamic(src net.Conn, dstConnFactory iokit.ConnFactoryFunc, closed bool) (chan iokit.Direction, error)
- type HttpPacket
- type HttpTransferContext
- type ParsePacketToConnFunc
Constants ¶
View Source
const ConnectEstablished = "HTTP/1.1 200 Connection established\n\n"
View Source
const RegExpMethods = http.MethodConnect + "|" + http.MethodGet + "|" + http.MethodHead + "|" + http.MethodPost + "|" + http.MethodPut + "|" + http.MethodPatch + "|" + http.MethodDelete + "|" + http.MethodOptions + "|" + http.MethodTrace
Variables ¶
This section is empty.
Functions ¶
func TransferFromListen ¶
func TransferFromListen(lAddr *net.TCPAddr, keepListening bool, output *HttpTransferContext) error
func TransferFromListenAddress ¶
func TransferFromListenAddress(lAddress string, keepListening bool, output *HttpTransferContext) error
func TransferTCPOrHTTP ¶
Types ¶
type HttpPacket ¶
func ResolvePacket ¶
func ResolvePacket(readLine []byte) (*HttpPacket, error)
func (HttpPacket) DialDSTConn ¶
func (p HttpPacket) DialDSTConn() (net.Conn, error)
func (HttpPacket) GetAddress ¶
func (p HttpPacket) GetAddress() string
func (HttpPacket) IsMethodConnect ¶
func (p HttpPacket) IsMethodConnect() bool
type HttpTransferContext ¶
type HttpTransferContext struct { LAddr *net.TCPAddr DAddr *net.TCPAddr KeepListening bool LListener *net.TCPListener DListener *net.TCPListener StopChan *chan os.Signal }
func BuildTransfer ¶
func BuildTransfer(lAddress string, keepListening bool) (*HttpTransferContext, error)
func (HttpTransferContext) GetDListener ¶
func (t HttpTransferContext) GetDListener() *net.TCPListener
func (HttpTransferContext) GetLListener ¶
func (t HttpTransferContext) GetLListener() *net.TCPListener
func (HttpTransferContext) Stop ¶
func (t HttpTransferContext) Stop()
func (HttpTransferContext) TransferFromListen ¶
func (t HttpTransferContext) TransferFromListen() error
type ParsePacketToConnFunc ¶
type ParsePacketToConnFunc func(*HttpPacket) (net.Conn, error)
Click to show internal directories.
Click to hide internal directories.