Comments (7)
Not sure what you mean, can you explain?
from restkit.
in class SimpleProxy (filter.py) i cant see any http proxy (not https) related thinks. there is a os.environ.get("https_proxy") and the https proxy handling, but no http_proxy stuff.
in other versions of SimpleProxy (maybe in other branches or older ones) was/is:
proxy = os.environ.get("https_proxy")
if proxy:
....
else:
proxy = os.environ.get("http_proxy")
if proxy:
...
from restkit.
mmm did you tested it ? If it doesn't work, let me know i will fix that.
from restkit.
i doesnt work :( here my testcode:
export http_proxy=http://proxy....:81 python test_restkit.py DEBUG:restkit.client:Start to perform request: GET search.twitter.com /search.json?q=gunicorn DEBUG:restkit.manager.base:key (('search.twitter.com', 80), False) DEBUG:restkit.client:create new connection DEBUG:restkit.client:close connection DEBUG:restkit.client:socket error: getaddrinfo returns an empty list Traceback (most recent call last): File "test_restkit.py", line 27, in print s.search("gunicorn") File "test_restkit.py", line 19, in search return self.get('search.json', q=query) File "/Users/chassing/workspace/xmc/lib/python2.6/site-packages/restkit/resource.py", line 112, in get params_dict=params_dict, **params) File "test_restkit.py", line 22, in request resp = super(TwitterSearch, self).request(*args, **kwargs) File "/Users/chassing/workspace/xmc/lib/python2.6/site-packages/restkit/resource.py", line 188, in request headers=self.make_headers(headers)) File "/Users/chassing/workspace/xmc/lib/python2.6/site-packages/restkit/client.py", line 558, in request return self.perform() File "/Users/chassing/workspace/xmc/lib/python2.6/site-packages/restkit/client.py", line 535, in perform raise RequestError(str(e)) restkit.errors.RequestError: getaddrinfo returns an empty list
cat test_restkit.py
from restkit import Resource import logging logging.basicConfig(level=logging.DEBUG) try: import simplejson as json except ImportError: import json # py2.6 only class TwitterSearch(Resource): def __init__(self, **kwargs): search_url = "http://search.twitter.com" super(TwitterSearch, self).__init__(search_url, follow_redirect=True, max_follow_redirect=10, **kwargs) def search(self, query): return self.get('search.json', q=query) def request(self, *args, **kwargs): resp = super(TwitterSearch, self).request(*args, **kwargs) return json.loads(resp.body_string()) if __name__ == "__main__": s = TwitterSearch() print s.search("gunicorn")
from restkit.
will fix that asap. Probably on monday since i'm out for the we at FOSDEM.
- benoit
from restkit.
last head should fix this issue, let me know :)
from restkit.
i've fixed some typos. http is working now. please have a lock filter.py line 80, proxy_uri is an undefined variable.
diff --git a/restkit/filters.py b/restkit/filters.py index 2c1cd14..508091a 100644 --- a/restkit/filters.py +++ b/restkit/filters.py @@ -64,15 +64,15 @@ class SimpleProxy(object): def on_connect(self, client, sck, ssl): proxy_settings = os.environ.get('%s_proxy' % - self.client.parsed_url.scheme) + client.parsed_url.scheme) if not proxy_settings: return if proxy_settings: - proxy_settings, proxy_auth = _get_proxy_auth(proxy_setting) - addr = parse_netloc(proxy_settings) + proxy_settings, proxy_auth = _get_proxy_auth(proxy_settings) + addr = parse_netloc(urlparse.urlparse(proxy_settings)) if ssl: if proxy_auth:
from restkit.
Related Issues (20)
- Documentation fails to build with Sphinx 1.2 HOT 1
- Document Error: Mixed case pool object typo in gevent example
- tests being installed in generic "tests" directory HOT 1
- Can't set headers per part of multipart requests HOT 1
- Add documentation on proxy usage
- Auth failed when password contains encoded / (slash)
- testsuite of -4.2.2; errors=6 HOT 1
- wsgi proxy and 'hop by hop' HOT 3
- WSGI proxy and Forwarded header
- un-contrib-ifying the proxy HOT 2
- minor performance optimization concerning location
- data coming out in wrong request HOT 1
- HostProxy misbehaves with spaces in PATH_INFO
- IOError: [Errno 0] Error on write() in tee.TeeInput._tee
- Doesn't Validate TLS HOT 4
- Exception in thread Thread-1 (most likely raised during interpreter shutdown
- no proxy support in restkit oauth? HOT 1
- Documentation for forms.py
- Attaching file to test result in test management 4 jira
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restkit.