daviddias / webrtc-explorer

:earth_africa: P2P Network Routing Overlay designed for the Web platform (browsers)
MIT License
288 stars 32 forks source link

Using several Explorer objects within one browser tab #9

Open Wasser-Eis opened 8 years ago

Wasser-Eis commented 8 years ago

Hi,

I want to use several peers (Explorer objects) within one browser tab such that one browser tab can register itself for several peerIDs.

e.g: var peer = new Explorer(config); var peer2 = new Explorer(config);

How should/can I modify the program code to make this work?

daviddias commented 8 years ago

Hey :) It should work, since the websockets signalling server is passed as a config value, you should be able to have multiple peers without too much trouble. If you find any constraint, feel welcome to submit a PR with the fix :)

Wasser-Eis commented 8 years ago

Thank you for the answer.

I have expressed myself not clearly enough. I want to register more than one peer (e.g. WebRTC-Explorer object) within one browser tab at the SAME signaling server. This means that in my example peer and peer2 should be connected to the same WebRTC-Explorer-Signalling-Server: var peer = new Explorer(config); var peer2 = new Explorer(config);

My goal is that one browser tab is responsible for several parts of a DHT keyspace. Therefore, I want to achieve that one browser tab can register itself for several peerIDs at the same signaling server.

daviddias commented 8 years ago

Originally, my intent was to be able to create several virtual nodes in One node and even be able to move that virtual node around (for Load Balancing purposes). So yes, the direction that you are headed is exactly part of where webrtc-explorer wants to go :)