Go 简单而强大的反向代理(Reverse Proxy)

h1z3y3 ·
```go func modifyRequest(req *http.Request) { req.Header.Set("X-Proxy", "Simple-Reverse-Proxy") // 去掉第一个地址 ss := strings.Split(req.RequestURI, "/") if len(ss) > 1 { ss = ss[2:] } req.URL.Path = "/" + strings.Join(ss, "/") } ```
#1