unsetbit / p

Peer-to-peer networking with browsers
http://unsetbit.com/p
Other
411 stars 27 forks source link

Wrong variable definition on README #9

Closed Matheusrma closed 9 years ago

Matheusrma commented 9 years ago

... var webRtcNode = webSocketNode.connect(address); // connect to a peer using an onramp connection var webRtcNode = webRtcNode.connect(address); ...

One of this two variables should be anyNode, right?

unsetbit commented 9 years ago

Nope, when you connect to an address from any node you'll end up with a web rtc node. "Any node" just means "web rtc or websocket" and the goal of P is to link up webrtc nodes together, so you can't, for example, connect to a websocket node from a webrtc node, but you can connect to a webrtc node from a websocket node. The reason is that you can always establish websocket connections directly without needing a signalling channel (unlike webrtc, where you always need a signaling channel, hence the "any node" business).