首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >socks5 helloworld

socks5 helloworld

原创
作者头像
vanguard
修改2020-03-19 17:43:40
1.7K0
修改2020-03-19 17:43:40
举报
文章被收录于专栏:vanguardvanguard

SOCKS is an Internet protocol that exchanges network packets between a client and server through a proxy server. SOCKS5 optionally provides authentication so only authorized users may access a server. Practically, a SOCKS server proxies TCP connections to an arbitrary IP address, and provides a means for UDP packets to be forwarded.

SOCKS5/Sokets5,可通过它的去间接的访问网络,相当于一个中转站。一般的代理协议比如Http代理都是工作在应用层的,效率比较低。而Socks代理协议提供一种通用的代理服务,工作在应用层和传输层之间,只是传递传输层网络数据包TCP/UDP,而不关心应用层的协议,该协议不包含加密。针对建立独立的网络非常有价值。

socks5 is a small module SOCKS version 5 library written fom scratch in Python, which is highly inspired by h11 and hyper-h2. It's a "bring-your-own-IO" library; that is socks5 module does not contain any network related code. socks5 only deal with the parsing and state management of the socks5 connection, the underlying IO part is not cover in the internal code.

Currently, socks5 module support the following protocol and rfc.

socks4

socks4a

socks5 : rfc 1928

socks5 username/password authentication: rfc 1929

pip install PySocks
# / requesocks
import socket
import socks
import requests

socks.set_default_proxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
socket.socket = socks.socksocket
print(requests.get('http://www.baidu.com').text)

Close your local proxy first

https://baike.baidu.com/item/SOCKS5%E4%BB%A3%E7%90%86

https://blog.csdn.net/qq_42679379/article/details/88067821

https://github.com/mike820324/socks5

https://zhuanlan.zhihu.com/p/30670193

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档