No SOCKS support

Bug #681648 reported by Ismael on 2010-11-26
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Pithos
New
Unknown
pithos (Ubuntu)
Wishlist
Unassigned

Bug Description

There should be support for SOCKS style proxies. SOCKS style proxies are used if you use ssh as a proxy.
For testing, do "ssh localhost -D 9999", this will create a SOCKS proxy on port 9999

You'll want to use Socksipy:
http://socksipy.sourceforge.net/

Here you can see how it should be used:
http://stackoverflow.com/questions/2317849/how-can-i-use-a-socks-4-5-proxy-with-urllib2

As a quick hack implementation, changing the set_proxy function (in pandora.py) for this:
    def set_proxy(self, proxy):
        print "PROXY", proxy
        if proxy:
            if "s:" in proxy:
                p = proxy.split(":")
                import socks
                import socket
                socket.socket = socks.socksocket
                socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, p[1], int(p[2]))

            proxy_handler = urllib2.ProxyHandler({'socks': proxy})
            self.opener = urllib2.build_opener(proxy_handler)
        else:
            self.opener = urllib2.build_opener()

And expecting socks proxy in the config menu as "s:ip:port", makes it work.

Changed in pithos:
status: New → Confirmed
importance: Undecided → Wishlist
Mike Pelley (mikepelley) wrote :

I found the hack provided by the reporter quite useful. An additional patch is required to retrieve album art across the socks proxy. Attached are two patches against the version of Pithos in "proposed" (due to https://bugs.launchpad.net/pithos/+bug/887886) which implement the above patch and the album art patch.

Mike Pelley (mikepelley) wrote :

Er... sorry, here are the correct patches.

Ian Turner (vectro) on 2018-08-13
affects: pithos → pithos (Ubuntu)
Changed in pithos:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.