http

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package http implements an http proxy server

Index

Constants

View Source
const Name = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyConn

type ProxyConn struct {
	net.Conn
	// contains filtered or unexported fields
}

用于纯http的 代理,dial后,第一次要把客户端的数据原封不动发送给远程服务端 就是说,第一次从 ProxyConn Read时,读到的一定是之前读过的数据,原理有点像 fallback

func (*ProxyConn) Read

func (pc *ProxyConn) Read(p []byte) (int, error)

func (*ProxyConn) ReadFrom

func (pc *ProxyConn) ReadFrom(r io.Reader) (n int64, e error)

ReadFrom implements the io.ReaderFrom ReadFrom method. 专门用于适配 tcp的splice.

type Server

type Server struct {
	proxy.ProxyCommonStruct
}

implements proxy.Server

func (*Server) CanFallback

func (*Server) CanFallback() bool

func (*Server) Handshake

func (s *Server) Handshake(underlay net.Conn) (newconn net.Conn, _ netLayer.MsgConn, targetAddr netLayer.Addr, err error)

func (*Server) Name

func (*Server) Name() string

type ServerCreator

type ServerCreator struct{}

func (ServerCreator) NewServer

func (ServerCreator) NewServer(dc *proxy.ListenConf) (proxy.Server, error)

func (ServerCreator) NewServerFromURL

func (ServerCreator) NewServerFromURL(u *url.URL) (proxy.Server, error)

Jump to

Keyboard shortcuts

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