I've been thinking about adding webRTC support to zeronet to enable browser-standalone bundles that could enable stuff like p2p commenting without having a zeronet node.
This would however require zeronetjs to use both the zeronet-v2 protocol and the multistream (libp2p) protocol (possibly on the same port)
My ideas:
Detect the client type based on the response (v2 handshake or /multistream/1.0.0) and then use appropriate client (multistream or zeronet-v2)
Pros:
Same port
Cons:
Ugly hacks required
Different dialing functions required
Only multistream server and zn client sent data first so it's hard to detect the client type in advance (possible solution: embed the type of the client in the multiaddr)
Different ports and multistream emulation:
Pros:
Easier to understand
Cons:
2 swarms required (awful to implement and maintain)
More announces required (both ports need to be advertised)
libp2p port cannot be announced on trackers as trackers do not store the client type
Detect the client type and emulate as /zn/2 multistream if client is zeronet-v2
Pros:
Same port
Fully libp2p
Same dialing function
Cons:
Special parameter for calling without multistream (reverse-multistream-emulation) required
Only multistream server and zn client sent data first so it's hard to detect the client type in advance (possible solution: embed the type of the client in the multiaddr)
Affected Components: swarm, protocol, client, node
I've been thinking about adding webRTC support to zeronet to enable browser-standalone bundles that could enable stuff like p2p commenting without having a zeronet node.
This would however require zeronetjs to use both the zeronet-v2 protocol and the multistream (libp2p) protocol (possibly on the same port)
My ideas: