nonocast / me

记录和分享技术的博客
http://nonocast.cn
MIT License
20 stars 0 forks source link

学习 Socks5 #299

Open nonocast opened 2 years ago

nonocast commented 2 years ago

client

curl -L -x socks5://127.0.0.1:7890 google.com

注: 前提是你的电脑上开了clash,或者其他梯子,你就算接触过socks5了。

然后你可以nc -l 3000开一个tcp listener, 然后修改curl为curl -L -x socks5://127.0.0.1:3000 google.com观察: 你可以发现从curl传过来4个字节,0502 0001,这个就是socks5的第一步协商请求。

# curl -L -x socks5://127.0.0.1:3000 google.com
~ nc -l 3000 | xxd -     
00000000: 0502 0001 

protocol

rfc 1928,一共才9页,算是一个非常简单的协议。简要描述一下curl http的逻辑:

参考阅读