Rev1913, Support local address other than 127.0.0.1
This commit is contained in:
parent
39734dfadb
commit
d57d82f439
6 changed files with 20 additions and 11 deletions
|
@ -116,7 +116,7 @@ class Connection(object):
|
|||
def handleIncomingConnection(self, sock):
|
||||
self.log("Incoming connection...")
|
||||
self.type = "in"
|
||||
if self.ip != "127.0.0.1": # Clearnet: Check implicit SSL
|
||||
if self.ip not in config.ip_local: # Clearnet: Check implicit SSL
|
||||
try:
|
||||
if sock.recv(1, gevent.socket.MSG_PEEK) == "\x16":
|
||||
self.log("Crypt in connection using implicit SSL")
|
||||
|
@ -176,7 +176,7 @@ class Connection(object):
|
|||
else:
|
||||
crypt_supported = CryptConnection.manager.crypt_supported
|
||||
# No peer id for onion connections
|
||||
if self.ip.endswith(".onion") or self.ip == "127.0.0.1":
|
||||
if self.ip.endswith(".onion") or self.ip in config.ip_local:
|
||||
peer_id = ""
|
||||
else:
|
||||
peer_id = self.server.peer_id
|
||||
|
|
|
@ -29,7 +29,7 @@ class ConnectionServer:
|
|||
self.tor_manager = None
|
||||
|
||||
self.connections = [] # Connections
|
||||
self.whitelist = ("127.0.0.1",) # No flood protection on this ips
|
||||
self.whitelist = config.ip_local # No flood protection on this ips
|
||||
self.ip_incoming = {} # Incoming connections from ip in the last minute to avoid connection flood
|
||||
self.broken_ssl_peer_ids = {} # Peerids of broken ssl connections
|
||||
self.ips = {} # Connection by ip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue