We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ export GOPROXY="https://goproxy.io"
的确好用, golang.org/x/...这些包都能go get到了.
golang.org/x/...
go get
release了新版本, 却怎么都go get不到
$ go: get ...... unexpected end of JSON input
各种尝试, 一顿搜索, 最后:
$ export GOPROXY=""
终于能go get到了.
墙才是最终的辣鸡;
The text was updated successfully, but these errors were encountered:
func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy { targetQuery := target.RawQuery director := func(req *http.Request) { req.URL.Scheme = target.Scheme req.URL.Host = target.Host req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path) if targetQuery == "" || req.URL.RawQuery == "" { req.URL.RawQuery = targetQuery + req.URL.RawQuery } else { req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery } if _, ok := req.Header["User-Agent"]; !ok { // explicitly disable User-Agent so it's not set to default value req.Header.Set("User-Agent", "") } } return &ReverseProxy{Director: director} }
原本代理本地的服务没有问题, 代理到微信服务就404. 参考了一篇博客: Go 语言实现 HTTP 层面的反向代理 加了一行代码:
404
func reverseProxy(target *url.URL) *httputil.ReverseProxy { targetQuery := target.RawQuery director := func(req *http.Request) { req.Host = target.Host // Different from the default NewSingleHostReverseProxy() req.URL.Scheme = target.Scheme req.URL.Host = target.Host req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path) if targetQuery == "" || req.URL.RawQuery == "" { req.URL.RawQuery = targetQuery + req.URL.RawQuery } else { req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery } if _, ok := req.Header["User-Agent"]; !ok { req.Header.Set("User-Agent", "") } } return &httputil.ReverseProxy{Director: director} }
反向代理成功.
Sorry, something went wrong.
No branches or pull requests
首先是因为有墙
的确好用,
golang.org/x/...
这些包都能go get
到了.然后提交了自己的工具包
release了新版本, 却怎么都
go get
不到见了鬼了, 辣鸡modules
各种尝试, 一顿搜索, 最后:
终于能
go get
到了.The text was updated successfully, but these errors were encountered: