• Avery Pennarun's avatar
    Don't allow proxying of connections to the proxy port. · cca69eb4
    Avery Pennarun authored
    Add some cleverness for breaking infinite loops.  Previously we'd only
    detect it successfully if you connected to exactly the same IP as we were
    listening on, but that was unreliable if we're listening on 0.0.0.0 and you
    connected to one of the IP addresses we haven't heard of.
    
    Now, if you try to connect to our listen port on *any* IP, we try binding to
    that IP as a local socket; if it works, that's a local IP, and therefore
    it's our socket, so reject the connection.  If it doesn't work, it's a
    remote IP, so forward it along.
    
    Thanks to 'tass' on github for noticing the problem.
    cca69eb4
client.py 7.54 KB