Bug#801136: mpd-sima: Troublesome with proxies
Geoff
efrim at azylum.org
Sat Oct 10 13:07:03 UTC 2015
Hi Chris,
Thanks very much for your report :)
Two issues then :
[packaging] http proxies env. var should be exposed when using
systemd/SystV.
[upstream] the http client should actually use them ^^
The http client bug was forwarded upstream, the issue is
identified/nearly fixed. Python requests is actually not honoring
HTTP_PROXY because of the use of the lower level API in the http client
which in turn is not propagating environment variables…
I'll try to fix this as soon as I can (I'm also the upstream developer).
Thanks again.
Geoff
The 06/10/2015 17:46, Chris Chiappa wrote :
> […]
> Behind a proxy, I've found it very difficult to get mpd-sima to use it
> for last.fm access. python-requests documentation at
> http://docs.python-requests.org/en/latest/ says it should pay
> attention to the HTTP_PROXY and HTTPS_PROXY environment variables. I
> created /etc/systemd/system/mpd-sima.service.d/override.conf
> with
>
> [Service]
> Environment="HTTP_PROXY=http://proxy.company.com:80"
> Environment="HTTPS_PROXY=http://proxy.company.com:80"
>
> and restarted mpd-sima. In /proc/<pid>/environ I can see both
> environment variables, but from both strace and mpd-sima's log I can
> see that it's failing to connect to last.fm. I was able to get it to
> work by hacking fetch_ws in http.py and manually specifying proxies:
>
> @Throttle(WAIT_BETWEEN_REQUESTS)
> def fetch_ws(self, prepreq):
> proxies = {
> "http" : "http://proxy.company.com:80",
> "https" : "http://proxy.company.com:80"
> }
> """fetch from web service"""
> sess = Session()
> sess.proxies = proxies
> resp = sess.send(prepreq, timeout=SOCKET_TIMEOUT)
> ...
>
> but that's obviously not the right way to do it. Not being a python
> hacker I'm not sure how to tell why the envrironment variables aren't
> working, but it seems like having some better way of configuring
> proxies might be desirable anyhow.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20151010/02253986/attachment-0001.sig>
More information about the pkg-multimedia-maintainers
mailing list