Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ReverseProxyCmd = &gcli.Command{ Name: "proxy", Func: rp.Run, Desc: "start a reverse proxy http server", Config: func(c *gcli.Command) { c.StrOpt( &rp.listen, "listen", "s", "127.0.0.1:1180", "local proxy server listen address.", ) c.StrOpt( &rp.remote, "remote", "r", "", "the remote reverse proxy server `address`. eg http://site.com:80;true", ) c.StrOpt( &rp.remoteIP, "remoteIP", "", "", "the remote reverse proxy server IP address.", ) }, }
ReverseProxyCmd command
Functions ¶
func ReverseProxy ¶
func ReverseProxy(targets ...*url.URL) *httputil.ReverseProxy
ReverseProxy create a global reverse proxy. Usage:
rp := ReverseProxy(&url.URL{
Scheme: "http",
Host: "localhost:9091",
}, &url.URL{
Scheme: "http",
Host: "localhost:9092",
})
log.Fatal(http.ListenAndServe(":9090", rp))
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.