Documentation ¶
Overview ¶
Package http implements http proxy for proxy.Server.
Reference ¶
rfc: https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.6
about basic auth:
https://en.wikipedia.org/wiki/Basic_access_authentication
https://datatracker.ietf.org/doc/html/rfc7617
example header:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Index ¶
Constants ¶
View Source
const Name = "http"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProxyConn ¶
用于纯http的 代理,dial后,第一次要把客户端的数据原封不动发送给远程服务端 就是说,第一次从 ProxyConn Read时,读到的一定是之前读过的数据,原理有点像 fallback
type Server ¶
type Server struct { proxy.Base *utils.MultiUserMap OnlyConnect bool //是否仅支持Connect命令; 如果为true, 则直接通过 GET http://xxx 这种请求不再被认为是有效的。之前本以为connect就可以搞定一切,后来实测发现 wget 确实在 非https时 会用 纯http请求的方式 请求代理。所以 一般 OnlyConnect 为 false即可. }
implements proxy.Server
func (*Server) CanFallback ¶
type ServerCreator ¶
type ServerCreator struct{}
func (ServerCreator) NewServer ¶
func (ServerCreator) NewServer(lc *proxy.ListenConf) (proxy.Server, error)
func (ServerCreator) NewServerFromURL ¶
Click to show internal directories.
Click to hide internal directories.