CARVIEW |
joshthecoder / tweepy
- Source
- Commits
- Network (8)
- Issues (2)
- Downloads (15)
- Wiki (2)
- Graphs
-
Branch:
master
-
Feature Requestx
Here's a changeset with one approach:
https://github.com/brianmichelich/tweepy/commit/5cd1b3d1ce5d760e6c4e08af353c4c1ce406b475This allows you to set a proxy_host and proxy_port on the API() and have binder.py pick them up when creating a connection.
Comments
-
Issue reported on twitter-dev mailing list by Josh Bleecher Snyder. Copy of email follows:
Hi all,
The tweepy twitter client uses api.twitter.com for the host for oauth calls:
REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token' AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize' AUTHENTICATE_URL = 'https://api.twitter.com/oauth/authenticate' ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
I've found that this works, until the user tries to sign out or sign
up during the authorization; if this happens, they get a 404. If,
however, twitter.com is used as the host:REQUEST_TOKEN_URL = 'https://twitter.com/oauth/request_token' AUTHORIZATION_URL = 'https://twitter.com/oauth/authorize' AUTHENTICATE_URL = 'https://twitter.com/oauth/authenticate' ACCESS_TOKEN_URL = 'https://twitter.com/oauth/access_token'
then everything, including signout and signup, works. This also
>
matches the instructions at
https://twitter.com/oauth_clients/details/%d.However, it strikes me as odd that the oauth stuff half works at
api.twitter.com.My question is: What is the bug? That the api.twitter.com oauth
endpoints only partially work -- in which case tweepy is fine and I
should file a bug with Twitter -- OR that the api.twitter.com oauth
works at all -- in which case I should ping the author of tweepy and
perhaps suggest to Twitter that they remove this partial functionality
to prevent future confusion?Many thanks,
Josh-----End of email------
Comments
joshthecoder Thu Dec 31 10:18:27 -0800 2009 | link
For now I have applied a patch on main @ e626b7e to resolve this issue until twitter fixes it on their end. OAuthHandler will use 'twitter.com' instead of 'api.twitter.com' as suggested in the email.
This issue will remain open until Twitter has resolved the issue and
'api.twitter.com' works as expected.
We can already provide a proxy host via the "host" parameter in the API init method.
There is not a way to provide a port though which could be easily added. I will look into providing this in the next release. Thanks!
Unless I missed something a changed host parameter would allow for a reverse proxy and I was setting up a forward proxy.
The reverse proxy worked when I sent the request to foo.com and forwarded to twitter.com. Setting a hosts on the connection as well as the request allowed the forward proxy to work. This allowed me to use a forward proxy without setting it for the python environment.