2023-10-14 04:16PM
参考: http://linlin.fun/blogs/865
1.先到GitHub下载需要的sthp,在assets里找到自己需要的版本。
https://github.com/KaranGauswami/socks-to-http-proxy/releases
我这里已经下载好了
~/coding_tools$ ll | grep sthp
-rwxrwxr-x 1 meiyi meiyi 8696024 7月 5 11:44 sthp-linux*
2. 把它变为可执行文件:
chmod +x sthp-linux
./sthp-linux
3. 查看本地的trojan的端口:
$ lsof -i:1090
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
firefox 4360 meiyi 97u IPv4 142775 0t0 TCP localhost:59596->localhost:1090 (ESTABLISHED)
firefox 4360 meiyi 103u IPv4 143570 0t0 TCP localhost:41276->localhost:1090 (ESTABLISHED)
firefox 4360 meiyi 115u IPv4 151606 0t0 TCP localhost:39056->localhost:1090 (ESTABLISHED)
firefox 4360 meiyi 121u IPv4 151608 0t0 TCP localhost:39068->localhost:1090 (ESTABLISHED)
firefox 4360 meiyi 153u IPv4 151721 0t0 TCP localhost:43064->localhost:1090 (ESTABLISHED)
firefox 4360 meiyi 2315u IPv4 126505 0t0 TCP localhost:48786->localhost:1090 (ESTABLISHED)
trojan 5431 meiyi 6u IPv4 51480 0t0 TCP localhost:1090 (LISTEN)
trojan 5431 meiyi 9u IPv4 144832 0t0 TCP localhost:1090->localhost:59596 (ESTABLISHED)
trojan 5431 meiyi 10u IPv4 152584 0t0 TCP localhost:1090->localhost:39056 (ESTABLISHED)
trojan 5431 meiyi 11u IPv4 144723 0t0 TCP localhost:1090->localhost:41276 (ESTABLISHED)
trojan 5431 meiyi 13u IPv4 153763 0t0 TCP localhost:1090->localhost:43064 (ESTABLISHED)
trojan 5431 meiyi 16u IPv4 149440 0t0 TCP localhost:1090->localhost:39068 (ESTABLISHED)
trojan 5431 meiyi 96u IPv4 130829 0t0 TCP localhost:1090->localhost:48786 (ESTABLISHED)
4. 设置端口:启动sthp:
$ ./sthp-linux -p 8090 -s 127.0.0.1:1090
5. 写一个文件:~/env_source_env
$ vim ~/env_source_env
然后在里面添加:
export HTTP_PROXY="http://127.0.0.1:8090"
export HTTPS_PROXY="http://127.0.0.1:8090"
export http_proxy="http://127.0.0.1:8090"
export https_proxy="http://127.0.0.1:8090"
6. 运行这个命令:
echo $HTTP_PROXY
发现返回空,需要先使用下面这个命令:
$ source ~/env_source_env
然后再重新运行 $ echo $HTTP_PROXY
$ echo $HTTP_PROXY
http://127.0.0.1:8090
这个时候,访问谷歌就非常快了。
$ curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
登录
请登录后再发表评论。
评论列表:
目前还没有人发表评论