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 ¶
Types ¶
type ProxyConn ¶
用于纯http的 代理,dial后,第一次要把客户端的数据原封不动发送给远程服务端 就是说,第一次从 ProxyConn Read时,读到的一定是之前读过的数据,原理有点像 fallback
type Server ¶
type Server struct { proxy.Base *utils.MultiUserMap OnlyConnect bool //是否仅支持Connect命令; 如果为true, 则直接通过 GET http://xxx 这种请求不再被认为是有效的。 }
implements proxy.Server
func (*Server) CanFallback ¶
type ServerCreator ¶
type ServerCreator struct{ proxy.CreatorCommonStruct }
func (ServerCreator) NewServer ¶
func (ServerCreator) NewServer(lc *proxy.ListenConf) (proxy.Server, error)
func (ServerCreator) URLToListenConf ¶ added in v1.2.4
func (ServerCreator) URLToListenConf(u *url.URL, lc *proxy.ListenConf, format int) (*proxy.ListenConf, error)
Click to show internal directories.
Click to hide internal directories.