mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-16 17:57:30 -05:00
pep8: no space after {[ or before ]}, reindent
This commit is contained in:
parent
aa2b59ec5d
commit
152bc32ba7
@ -145,7 +145,7 @@ class OnionShare(object):
|
|||||||
del hsdic['HiddenServicePort'][dropme]
|
del hsdic['HiddenServicePort'][dropme]
|
||||||
hsdic['HiddenServiceDir'] = hsdic.get('HiddenServiceDir', [])+[self.hidserv_dir]
|
hsdic['HiddenServiceDir'] = hsdic.get('HiddenServiceDir', [])+[self.hidserv_dir]
|
||||||
hsdic['HiddenServicePort'] = hsdic.get('HiddenServicePort', [])+[
|
hsdic['HiddenServicePort'] = hsdic.get('HiddenServicePort', [])+[
|
||||||
'80 127.0.0.1:{0}'.format(self.port) ]
|
'80 127.0.0.1:{0}'.format(self.port)]
|
||||||
|
|
||||||
self.controller.set_options(hsdic2list(hsdic))
|
self.controller.set_options(hsdic2list(hsdic))
|
||||||
|
|
||||||
|
@ -105,25 +105,28 @@ class HTTPError(ProxyError):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
SOCKS4_ERRORS = { 0x5B: "Request rejected or failed",
|
SOCKS4_ERRORS = {
|
||||||
0x5C: "Request rejected because SOCKS server cannot connect to identd on the client",
|
0x5B: "Request rejected or failed",
|
||||||
0x5D: "Request rejected because the client program and identd report different user-ids"
|
0x5C: "Request rejected because SOCKS server cannot connect to identd on the client",
|
||||||
}
|
0x5D: "Request rejected because the client program and identd report different user-ids",
|
||||||
|
}
|
||||||
|
|
||||||
SOCKS5_ERRORS = { 0x01: "General SOCKS server failure",
|
SOCKS5_ERRORS = {
|
||||||
0x02: "Connection not allowed by ruleset",
|
0x01: "General SOCKS server failure",
|
||||||
0x03: "Network unreachable",
|
0x02: "Connection not allowed by ruleset",
|
||||||
0x04: "Host unreachable",
|
0x03: "Network unreachable",
|
||||||
0x05: "Connection refused",
|
0x04: "Host unreachable",
|
||||||
0x06: "TTL expired",
|
0x05: "Connection refused",
|
||||||
0x07: "Command not supported, or protocol error",
|
0x06: "TTL expired",
|
||||||
0x08: "Address type not supported"
|
0x07: "Command not supported, or protocol error",
|
||||||
}
|
0x08: "Address type not supported",
|
||||||
|
}
|
||||||
|
|
||||||
DEFAULT_PORTS = { SOCKS4: 1080,
|
DEFAULT_PORTS = {
|
||||||
SOCKS5: 1080,
|
SOCKS4: 1080,
|
||||||
HTTP: 8080
|
SOCKS5: 1080,
|
||||||
}
|
HTTP: 8080,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, username=None, password=None):
|
def set_default_proxy(proxy_type=None, addr=None, port=None, rdns=True, username=None, password=None):
|
||||||
@ -205,10 +208,11 @@ class socksocket(socket.socket):
|
|||||||
self.proxy_sockname = None
|
self.proxy_sockname = None
|
||||||
self.proxy_peername = None
|
self.proxy_peername = None
|
||||||
|
|
||||||
self.proxy_negotiators = { SOCKS4: self._negotiate_SOCKS4,
|
self.proxy_negotiators = {
|
||||||
SOCKS5: self._negotiate_SOCKS5,
|
SOCKS4: self._negotiate_SOCKS4,
|
||||||
HTTP: self._negotiate_HTTP
|
SOCKS5: self._negotiate_SOCKS5,
|
||||||
}
|
HTTP: self._negotiate_HTTP,
|
||||||
|
}
|
||||||
|
|
||||||
def _recvall(self, count):
|
def _recvall(self, count):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user