python sock5代理
安装 pysocks:pip install pysocks
# coding:utf-8
'''
@version: python3.6
@author: ‘eric‘
@license: Apache Licence
@contact: steinven@qq.com
@software: PyCharm
@file: pysocks.py
@time: 2020/9/25 16:27
'''
import socket
import requests
#pip install pysocks
import socks
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 9311)
socket.socket = socks.socksocket
def main():
url = 'https://api.ip.sb/ip'
html = requests.get(url).text
print(html)
if __name__ == '__main__':
main()