Bug#801136: mpd-sima: Troublesome with proxies
Geoff
efrim at azylum.org
Sat Oct 10 15:45:09 UTC 2015
Followup-For: Bug #801136
Package: mpd-sima
Tags: patch, confirmed
Here is a patch, it should merge available HTTPS?_PROXIES variables.
I will patch the debian package if it takes too long to release the next
upstream version including this fix.
I haven't fully tested the solution yet.
Don't hesitate to give it a try, the patch should merge fine on 0.13.
I'll have a look at the packaging part later.
Cheers
Geoff
Le 10/10/2015 15:07, Geoff a écrit :
> 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: http.proxy.diff
Type: text/x-patch
Size: 944 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20151010/31158dde/attachment.bin>
-------------- 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/31158dde/attachment.sig>
More information about the pkg-multimedia-maintainers
mailing list