tweepy/tweepy — Issue #125: Problems with adding SOCKS proxy support
Author: xiaohan2012
Created: 2011-10-11 12:35:35+00:00
State: open

I am trying to add SOCKS 5 support to tweepy.
And I added the following code in the __init__.py file.

import socks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 7070)
socket.socket = socks.socksocket

**socks** is from
http://sourceforge.net/projects/socksipy/
[socksipy](http://sourceforge.net/projects/socksipy/)

I tested socksipy with the urllib separately, it works well to fetch data.

But if I test it with tweepy, it seems that the httplib is making things wrong. Because I see the exception information.
*TweepError: Failed to send request: [Errno 104] Connection reset by peer*

Can you tell me how to work around with this?