Total Pageviews

Monday 27 June 2022

在windows上,安装socks proxy to http proxy的生成工具折腾记

在win11上,按此文https://briteming.blogspot.com/2022/02/windows10-3-chocolateyscoop-winget.html 安装scoop. 在运行这步命令:irm get.scoop.sh | iex时,irm要访问 get.scoop.sh ,

其实就是访问https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1,但是域名*.githubusercontent.com已被封,所以直接访问是访问不了的,需要通过代理访问才行,所以,这步命令:irm get.scoop.sh | iex需要改为

irm get.scoop.sh -Proxy 'http://127.0.0.1:7080'  | iex

(这里, http://127.0.0.1:7080为某个本地的http proxy的地址。因为irm要访问*.githubusercontent.com,所以要给irm设置代理,通常是http proxy. 详见https://github.com/scoopinstaller/install)

但是,可以用来翻墙的http proxy很少,远不如socks proxy多,那么我们可以考虑使用socks proxy to http proxy的生成/转换工具,从已有的socks proxy生成一个http proxy。这样的生成/转换工具,我首先想到了privoxy,但是遇到了权限问题,编辑privoxy的配置文件总是失败,后又

尝试了polipo,在下载的压缩包中竟然没有可执行文件,所以 polipo无法使用。后又

尝试了3proxy,它可能是升级了,新的配置文件太复杂,也未搞定。于是试着使用其他的socks proxy to http proxy的生成/转换工具(见此文https://briteming.blogspot.com/2018/02/socks-proxyhttp-proxy-hpts.html),绝大多数需要在win11上,安装相应的编程语言环境。而在windows

上,安装编程语言环境远不如linux/mac上那样方便,所以左挑右拣,选中了那种提供现成的exe文件的socks proxy to http proxy的生成/转换工具,比如

https://github.com/juanmv94/SOCKS2HTTP
 
先在win11上运行一个local socks proxy,比如qsocks
(https://briteming.blogspot.com/2022/05/qsocks.html). 先下载
 
https://go.dev/dl/go1.18.3.windows-amd64.msi,并安装它。然后下载https://github.com/net-byte/qsocks/archive/refs/heads/main.zip, 解压出qsocks-master目录,进入该目录,运行go install ,就会成功安装
qsocks,运行:

qsocks -s vps-public-ip:1443 -l 127.0.0.1:10800 -ck certs/client.key -cp certs/client.pem -sk certs/server.key -sp certs/server.pem

不要关闭此终端,这样,local socks proxy 127.0.0.1:10800就运行起来了。
 
然后,下载https://github.com/juanmv94/SOCKS2HTTP/archive/refs/heads/master.zip
解压出SOCKS2HTTP-master目录,进入该目录,运行:
SOCKS2HTTP.exe 7080 localhost 10800 local ,这样就从本地的socks proxy localhost:10800生成了一个http proxy localhost:7080
 
 

No comments:

Post a Comment