Posted in Python onJanuary 14, 2015
首先,你得下载SocksiPy这个.解压出来之后里面会有一个socks.py文件.然后你可以把这个文件复制到python安装目录里面的Lib\site-packages中.或者把这个文件复制到程序所在的目录中.
然后就可以再程序中使用socket代理来编写程序了.
下面是示例代码
import socks import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,"127.0.0.1",8088)
socket.socket =socks.socksocket import urllib2
urllib2.urlopen('http://www.baidu.com').read()
原文:为python设置socket代理
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
python django集成cas验证系统
Jul 14
Python
Python中的异常处理学习笔记
Jan 28
Python
Python中字典和集合学习小结
Jul 07
Python
Anaconda多环境多版本python配置操作方法
Sep 12
Python
PyCharm代码格式调整方法
May 23
Python
Python引用计数操作示例
Aug 23
Python
python os.path模块常用方法实例详解
Sep 16
Python
python 通过麦克风录音 生成wav文件的方法
Jan 09
Python
python循环输出三角形图案的例子
Nov 22
Python
python实现飞行棋游戏
Feb 05
Python
简单了解python shutil模块原理及使用方法
Apr 28
Python
Tensorflow使用Anaconda、pycharm安装记录
Jul 29
Python
Reply on: @reply_date@
@reply_contents@