uProxy/socks-rtc — pull request #91 by dborkan (2014-06-08 18:56:03+00:00)
Title: Remove peer from server after closing, so that a new rtc-to-net connection can be started later with the same peerId

Prior to this change, if Alice proxied through Bob, then closed the proxy, then restarted a proxy through Bob, rtc-to-net on Bob's (the server) side would fail because it would try to re-use an already closed Peer (wrapper around freedom.transport). I'm fixing this by having the Peer remove itself from the server's mapping after it is closed, that way a new Peer object will be created each time a proxy is attempted.

This is needed for issue https://github.com/uProxy/uProxy/issues/44 (proxying a 2nd time with the same peer fails), although it does not completely fix that issue (we are still hitting XMPP 503 (probably throttling) errors the 2nd time, for which we have issue https://github.com/uProxy/uProxy/issues/186)

Tested manually (verified we no longer see errors about setRemoteDescription failing for a closed RTCPeerConnection objected), and re-ran grunt test.