yryz / httpproxy Goto Github PK
View Code? Open in Web Editor NEW一个轻量级HTTP代理,支持shadowsocks服务,方便命令行、开发环境使用。
License: Apache License 2.0
一个轻量级HTTP代理,支持shadowsocks服务,方便命令行、开发环境使用。
License: Apache License 2.0
2017-10-24 12:29:08 WARNING unsupported addrtype 132, maybe wrong password 2017-10-24 12:29:08 ERROR can not parse header
是否支持websocket代理?
如题所示
我代理后,访问https://www.baidu.com不行,会报如下错误
INFO[2019-09-21T16:40:31+08:00] CONNECT www.baidu.com:443
ERRO[2019-09-21T16:40:31+08:00] ss dial: dial tcp: lookup tcp/port: nodename nor servname provided, or not known
2019/09/21 16:40:31 http: response.WriteHeader on hijacked connection from github.com/yryz/httpproxy/proxy.(*ProxyServer).HandleConnect (proxy.go:67)
2019/09/21 16:40:31 http: response.Write on hijacked connection from fmt.Fprintln (print.go:266)
原因:
proxy.go文件第90行,没有把resp, err := tr.RoundTrip(r)
中resp的status值传递给w http.ResponseWriter
,导致返回值全是200。这样会造成比如访问http网站做301跳转https失效。
解决:
应该在107行//copy body
的前一行添加w.WriteHeader(resp.StatusCode)
怎么使用gfwlist.txt来做分流呢?
首先,感谢编写了这个工具,之前一直用polipo做中转,还纳闷过为什么ss客户端的本地部分非得用socks5监听,就不能提供一个http的代理?我倒是琢磨过干脆自己实现一个,结果要么没时间,要么忘记了。看到你这有现成的了真是太好了。
看了一下你的config.go,配置文件硬编码到了~/.httpproxy/config.json
。一般命令行工具除了有默认的配置文件路径以外还会提供参数让用户直接传递配置文件路径。所以我建议能加一个-c
flag,可以让用户指定配置文件,这样也好方便做系统启动直接运行的服务。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.