struct ReverseProxy
XuAPI
pub struct ReverseProxy {
pub target string
pub client http.Client
}用途
承载 target、client 等属性的结构体。
公开字段
targetstring- 字段(string)
clienthttp.Client- 字段(http.Client)
#net/http/httputil标准库包 `#net/http/httputil`。
struct ReverseProxypub struct ReverseProxy {
pub target string
pub client http.Client
}承载 target、client 等属性的结构体。
target stringclient http.Clientnew_single_host_reverse_proxypub fn new_single_host_reverse_proxy(target string) ReverseProxy构造 single host reverse proxy。
target stringReverseProxy — 该类型的值
($&ReverseProxy) serve_httppub fn (p $&ReverseProxy) serve_http(c http.Context)$&ReverseProxy 上的操作:执行 serve http 操作。
p $&ReverseProxyReverseProxy 实例;以独占借用传入,方法可修改它,调用方仍持有实例。c http.Context不返回值。
dump_requestpub fn dump_request(c http.Context) string转储请求。
c http.Contextstring — 结果字符串
dump_responsepub fn dump_response(resp http.Response) string转储响应。
resp http.Responsestring — 结果字符串