Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running into a problem with proxys on a firewalled network. #5

Open
punkscience opened this issue Apr 9, 2021 · 1 comment
Open

Comments

@punkscience
Copy link

Running on a Macbook Pro, I am getting the following errors on the website example right out of the box. I do have a "HTTP_PROXY" in my env -- not sure if that's relevant or not but this is the error I am running into:

Traceback (most recent call last):
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/adapters.py", line 412, in send
conn = self.get_connection(request.url, proxies)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/adapters.py", line 309, in get_connection
proxy_manager = self.proxy_manager_for(proxy)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/adapters.py", line 193, in proxy_manager_for
manager = self.proxy_manager[proxy] = proxy_from_url(
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/urllib3/poolmanager.py", line 536, in proxy_from_url
return ProxyManager(proxy_url=url, **kw)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/urllib3/poolmanager.py", line 480, in init
raise ProxySchemeUnknown(proxy.scheme)
urllib3.exceptions.ProxySchemeUnknown: Proxy URL had no scheme, should start with http:// or https://

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/dwright2/projects/listenbrainz/go.py", line 4, in
listens = client.get_listens(username='punkscience')
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/pylistenbrainz/client.py", line 278, in get_listens
data = self._get(
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/pylistenbrainz/client.py", line 94, in _get
response = requests.get(
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/Users/dwright2/projects/listenbrainz/venv/lib/python3.9/site-packages/requests/adapters.py", line 414, in send
raise InvalidURL(e, request=request)
requests.exceptions.InvalidURL: Proxy URL had no scheme, should start with http:// or https://

@mxjeff
Copy link

mxjeff commented Apr 11, 2021

Requests relies on the proxy configuration defined by standard environment variables http_proxy and https_proxy. Requests expects an URL, be sure the HTTP_PROXY exposes the protocol as well (not only the IP:PORT):

HTTP_PROXY="http://10.10.1.10:3128"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants