crk wrote:
3. Edit /sabnzbd/newswrapper.py
where: line 166 after the else branch
desc: change the object from socket to socks and the method from socket to socksipys socksocket which receives the same arguments
todo:
replace
Code: Select all
self.sock = socket.socket(af, socktype, proto)
with
Code: Select all
self.sock = socks.socksocket(af, socktype, proto)
where: Underneath last insert
desc: Setup proxy connection for object "sock". This one is for authentification with socks5. To use socks4, http and socks4a please read the manual.
todo:
insert
Code: Select all
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5,"IP_OR_DOMAIN",PORT,True,"USERNAME","PASSWORD")
Or - if authentification is not needed, just take:
Code: Select all
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5,"IP_OR_DOMAIN",PORT)
where: import section (line 20-30)
desc: Make the script use socksipy.
todo:
Add new line, for example after line 20
That's it. Now you can connect to server. You can check servers in server setup.
Currently, f00b4r is working on a SSL connection implementation. Time will tell .. weekend will bring
BTW a Socks5 improves my speed from ~110 mbit to ~240 which isnt the End of my Connection, so i think Socks5 support would be a nice
feature for many other users. Now iam not able to use proxycap un my ubuntu box.
So i changed the newswrapper.py like this :
Code: Select all
----------------------------------------------------------------SNIP--------------------------------------------------------------
class NNTP(object):
def __init__(self, host, port, info, sslenabled, nw, user=None, password=None, block=False, write_fds=None):
assert isinstance(nw, NewsWrapper)
self.host = host
self.port = port
self.nw = nw
self.blocking = block
self.error_msg = None
if not info:
if block:
info = GetServerParms(host, port)
else:
raise socket.error(errno.EADDRNOTAVAIL, "Address not available - Check for internet or DNS problems")
af, socktype, proto, canonname, sa = info[0]
if sslenabled and _ssl:
# Some users benefit from SSLv2 not being capped.
ssl_type = sabnzbd.cfg.ssl_type.get()
if ssl_type == 'v2':
ctx = _ssl.Context(_ssl.SSLv2_METHOD)
elif ssl_type == 'v3':
ctx = _ssl.Context(_ssl.SSLv3_METHOD)
else:
ctx = _ssl.Context(_ssl.SSLv23_METHOD)
self.sock = SSLConnection(ctx, socket.socket(af, socktype, proto))
elif sslenabled and not _ssl:
logging.error(Ta('Error importing OpenSSL module. Connecting with NON-SSL'))
self.sock = socks.socksocket(af, socktype, proto)
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5,"1.1.0.248",1080)
else:
self.sock = socks.socksocket(af, socktype, proto)
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5,"1.1.0.248",1080)
----------------------------------------------------------------SNIP--------------------------------------------------------------
1.1.0.248 is just for local testing
But i get an Error launching sabnzbd :
Code: Select all
service sabnzbdplus restart
* SABnzbd+ binary newsgrabber: not running
* Starting SABnzbd+ binary newsgrabber Traceback (most recent call last):
File "/usr/bin/sabnzbdplus", line 66, in <module>
import sabnzbd
File "/usr/share/sabnzbdplus/sabnzbd/__init__.py", line 65, in <module>
from sabnzbd.nzbqueue import NzbQueue
File "/usr/share/sabnzbdplus/sabnzbd/nzbqueue.py", line 40, in <module>
import sabnzbd.downloader
File "/usr/share/sabnzbdplus/sabnzbd/downloader.py", line 32, in <module>
from sabnzbd.newswrapper import NewsWrapper, request_server_info
File "/usr/share/sabnzbdplus/sabnzbd/newswrapper.py", line 173
self.sock.setproxy(socks.PROXY_TYPE_SOCKS5,"1.1.0.248",1080)
^
IndentationError: unexpected indent
I am pretty sure i missunderstood the instructions. Iam also absolute not famialar with phyton.
But i can provide an highspeed socks5(Gbit) for testing your pretty-shiny new sabnzbd release :].
Can someone Help me with an "quick" solution?
Thanks!
derdigge