https://github.com/lubyruffy/https2http
把https的代理变成http的代理
https://github.com/lubyruffy/https2http
Last synced: 9 months ago
JSON representation
把https的代理变成http的代理
- Host: GitHub
- URL: https://github.com/lubyruffy/https2http
- Owner: LubyRuffy
- Created: 2022-07-30T05:07:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-01T15:53:13.000Z (10 months ago)
- Last Synced: 2025-03-01T16:32:35.701Z (10 months ago)
- Language: Go
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# https2http
把https的代理变成http的代理。
## 背景
有特别多的代理软件不支持https,只支持http,比如在windows下面有一个最好用的全局代理软件Proxifier,它就不支持最简单的https代理服务器。
## 方案
为了支持其他一些代理软件,我们需要进行一个转换,upstream的是https,本地是http,这样就能够完成网络请求流程了。
```text
app <-> proxy(Proxifier) <-> https2http <-> https proxy
```
## 运行
```shell
https2http -proxy https://proxy.xxx.com -addr :8080
```
直接用gost也可以:
```shell
git clone https://github.com/ginuerzh/gost.git
cd gost/cmd/gost
go build
./gost.exe -L=:8080 -F=https://proxy.xxx.com
```
## 辅助工具
- 通过fofa提取代理:
```shell
proxychecker -query 'type="service" && protocol="http" && banner="ERR_INVALID_URL"' -expr 'response.Header("Server")=~"(?is)(bws|bfe)"' -target https://www.baidu.com -size 100
proxychecker -query 'port="3128" && title="ERROR: The requested URL could not be retrieved"' -expr 'response.Header("Server")=~"(?is)(bws|bfe)"' -target https://www.baidu.com -size 100
```
http代理测试,这种规则基本都在中国的代理:[port="9091" && banner="403 Forbidden" && banner="nginx/1.12.1"](https://fofa.info/result?qbase64=cG9ydD05MDkxICYmIGJhbm5lcj0iNDAzIEZvcmJpZGRlbiIgJiYgYmFubmVyPSJuZ2lueC8xLjEyLjEi)
```shell
proxychecker -query 'port=9091 && banner="403 Forbidden" && banner="nginx/1.12.1"' -expr 'response.Body()=~"(?is)百度一下"' -target http://www.baidu.com -size 1000
```
检查Mikrotik代理: [banner="Mikrotik HttpProxy"](https://fofa.info/result?qbase64=YmFubmVyPSJNaWtyb3RpayBIdHRwUHJveHki)
```shell
proxychecker -query 'banner="Mikrotik HttpProxy"' -expr 'response.Body()=~"(?is)百度一下"' -target http://www.baidu.com -size 1000
```
检查socks5代理: [banner="Authentication(0x00)"](https://fofa.info/result?qbase64=YmFubmVyPSJBdXRoZW50aWNhdGlvbigweDAwKSI%3D)
```shell
proxychecker -query 'banner="Authentication(0x00)"' -expr 'response.Body()=~"(?is)百度一下"' -target http://www.baidu.com -size 1000 -type socks5
```
检查socks5代理: [body="This is a proxy server. Does not respond to non-proxy requests."](https://fofa.info/result?qbase64=Ym9keT0iVGhpcyBpcyBhIHByb3h5IHNlcnZlci4gRG9lcyBub3QgcmVzcG9uZCB0byBub24tcHJveHkgcmVxdWVzdHMuIg%3D%3D)
```shell
# 应该是通用组件,在请求www.baidu.com的情况下会提示错误:dial tcp: address [2405:19c0:c303:423d:deef:db8e:1c8d:ecb0]:0: no suitable address found
proxychecker -query 'body="This is a proxy server. Does not respond to non-proxy requests."' -expr 'response.Body()=~"(?is)百度一下"' -target http://www.baidu.com -size 1000 -type http
proxychecker -query 'body="This is a proxy server. Does not respond to non-proxy requests."' -expr 'response.Body()=~"(?is)GeoNameID"' -target http://ip.bmh.im/h -size 1000 -type http
```