Closed monicanagent closed 5 years ago
This might be a good place to start: https://github.com/freedomjs/freedom-port-control
Unfortunately none of the existing NPM libraries and NAT hole punching techniques (NAT-PMP, PCP, uPnP) seem to be effective. However, since Electron includes a fully functional version of Chrome, WebRTC can be leveraged to accomplish this functionality.
In addition to updating the P2P communication functionality of CypherPoker.JS, RPC functions should also be call-able via WebRTC. This will require some sort of dynamic server and message routing capabilities with the following logic:
Initial connect:
On table join:
On send-to-peer:
On invoke RPC:
The server will also need to be updated in order to route messages between WebRTC-connected peers and WSS-connected peers.
Most likely there will be additional implementation details to follow.
Updated issue title to reflect new direction (re: WebRTC)
Implemented in revision 167 (https://github.com/monicanagent/cypherpoker.js/commit/1af643d72bb416c49fdd7dd98f44cd435f2a9ce5).
Add reliable NAT hole punching/binding capabilities to server code (https://github.com/monicanagent/cypherpoker.js/tree/master/src/server), in order to enable public server/peer node capabilities without the need for manual router updates.