Page 2 of 3

Re: Adding SOCKS support for SAB

Posted: September 1st, 2010, 4:59 pm
by bullox
So this fix can't be done on OSX unless i run it from sources? sucks. Well thanks anyways!

Re: Adding SOCKS support for SAB

Posted: September 2nd, 2010, 3:38 am
by shypike
I am willing to add the code to the next release.
However, I have 0 means of testing it.
All I have been able to test is that the added code doesn't disturb normal operation.

Re: Adding SOCKS support for SAB

Posted: October 3rd, 2010, 5:53 am
by f00b4r
SOCKS for SSL is as simple as stated by crk, around line 164 of newswrapper.py :

Code: Select all

s = socks.socksocket()
s.setproxy(2,sabnzbd.cfg.socks_host.get(),sabnzbd.cfg.socks_port.get(),"True",sabnzbd.cfg.socks_login.get(),sabnzbd.cfg.socks_password.get())
#self.sock = SSLConnection(ctx, socket.socket(af, socktype, proto))
self.sock = SSLConnection(ctx, s)
As you can see I am using parameters found in the config. It is also quite easy, just have to add the following to cfg.py aroud line 188 :

Code: Select all

socks_host = OptionStr('misc', 'socks_host','proxy.example.com')
socks_port = OptionNumber('misc', 'socks_port',8080)
socks_login = OptionStr('misc','socks_login',"login")
socks_password = OptionStr('misc','socks_password',"password")
As for using these parameters in the web interface...not that easy , but stille doable. But the dev team should not find that really difficult :)

In config_server.tmpl (for "smpl" skin) :

Code: Select all

<label class="label">Proxy:</label><input type="text" name="socks_host" value="$servers[$server]['socks_host']" ></label>
<br class="clear" />
<label class="label">Port:</label><input type="text" name="socks_port" value="$servers[$server]['socks_port']" ></label>
<br class="clear" />
<label class="label">Login:</label><input type="text" name="socks_login" value="$servers[$server]['socks_login']" ></label>
<br class="clear" />
<label class="label">Password:</label><input type="password" name="socks_password" value="$servers[$server]['socks_password']" ></label>
<br class="clear" />
In config.py, line 343 :

Code: Select all

self.socks_host = OptionStr('misc', 'socks_host','proxy.example.com',add=False)
self.socks_port = OptionNumber('misc', 'socks_port',8080,add=False)
self.socks_login = OptionStr('misc', 'socks_login','login',add=False)
self.socks_password = OptionStr('misc', 'socks_password','password',add=False)
It is really dirty...but it works. As I look back at it, maybe I've made some mistakes :)

Re: Adding SOCKS support for SAB

Posted: October 28th, 2010, 8:58 am
by shockin
Will this be implemented in the next version?

Re: Adding SOCKS support for SAB

Posted: October 30th, 2010, 7:59 pm
by noroger
Pardon my foolishness, but where is the "/sabnzbd/newswrapper.py"? I don't see it in my SABnzbd 0.5.4 dir

Re: Adding SOCKS support for SAB

Posted: October 31st, 2010, 4:50 am
by shypike
You need to download the source distribution (ending in tar.gz),
setup ActiveState Python and install some Python modules.
http://wiki.sabnzbd.org/windows-source

Re: Adding SOCKS support for SAB

Posted: October 31st, 2010, 5:53 pm
by noroger
argh, way too much messing around with my expertise.


Either I go back to using alt.binz or use a VPN service  :(

Re: Adding SOCKS support for SAB

Posted: November 1st, 2010, 3:26 am
by shypike
I understand.
Proxy support has a low priority now as we're completing the next major release.

Re: Adding SOCKS support for SAB

Posted: November 1st, 2010, 9:32 pm
by noroger
no problem. I switched to a VPN for now but I really prefer SSH. It's cheaper and faster

but please do implement it, the code is already writen  :)

Re: Adding SOCKS support for SAB

Posted: November 2nd, 2010, 3:18 am
by shypike
noroger wrote: the code is already writen  :)
But only tested in one (maybe two) situations.
There is a huge variation in proxies (and the way they are configured).
Implementing it will lead to a lot of support issues, because it will
not work for everybody.

Re: Adding SOCKS support for SAB

Posted: November 7th, 2011, 12:13 pm
by exussum
i know this is an old topic,

but is there any update ?

https://blueprints.launchpad.net/sabnzb ... nntp-proxy

Seen this that is scheduled for 0.6.x
Thanks for your efforts !

Re: Adding SOCKS support for SAB

Posted: November 7th, 2011, 1:38 pm
by shypike
It's not going to happen, sorry.
There are just too many more urgent matters.
Other than that, I repeat that we could never test this in a sufficient number of situations.
It would give endless support questions.

Re: Adding SOCKS support for SAB

Posted: November 12th, 2011, 10:13 pm
by exussum
Does sab use the defualt connection ?

Eg in windows the one Chrome and IE use or a direct connection like firefox ?

Re: Adding SOCKS support for SAB

Posted: November 13th, 2011, 6:07 am
by shypike
The behaviour is a bit uneven.
The Usenet connections are always direct.
However, http traffic to index sites will be routed through the active proxy for IE.
The latter is just incidental, because that's how Python's http support library works.

Re: Adding SOCKS support for SAB

Posted: November 15th, 2011, 5:19 pm
by sander
FWIW: the smallest SOCKS server on Linux / Ubuntu is this:

Code: Select all

ssh -D 1080 localhost
You have to type your local login password. And that's it: your SOCKS server is running! (Well, you must have ssh server installed and running).

To test that your SOCKS server is running, you can set your webbrowser's SOCKS setting to 127.0.0.1 and port 1080. It works for my Chrome. :)

And this way I was able to run the SOCKS-pached version of SABnzbd. Although technically interesting, I don't see a good reason to have SOCKS in SABnzbd; AFAIK, SOCKS is used on corporate networks. On such corporate networks, I would say using SABnzbd is "not done".


PS: If you have a login somewhere on some remote *ix system, you can use that system as a SOCKS too: just type "ssh -D 1080 [email protected]". The SOCKS server will be local, and will tunnel the traffic to / through that remoteserver. So the SOCKS proxy server is a tunnel from your own machine via the remote server to Internet.
Keep using 127.0.0.1 and 1080 as your SOCKS settings in Chrome, and Chrome will use the remoserver.com as SOCKS proxy ... check with http://whatismyipaddress.com/ or http://test-ipv6.com/ :)