Is pubsub supported in the browser directly, without the need for node-modules or a web packager? I found a few tutorials and reviewed the example code, but everything is suggesting I will need to use a node server. I would like to be able to run this serverless in the browser, and I prefer not to use a web packager like browserify.
If it is possible, would you mind sharing an example? I could not find anything that worked.
You need peers to send pubsub messages to, so unless you know peer addresses out of band and manually dial them you need some way of discovering those peers.
To do browser -> browser right now that means connecting to a webrtc-star server to do that initial peer discovery - there are public webrtc servers but they have no uptime guarantees so shouldn’t be used in a production setting - you should stand your own webrtc servers up for this.
We’ve had discussions elsewhere about standing up and supporting webrtc servers that can be used publicly, which we’ll do as part of what we’re doing at Fission.
I’ve been playing around with an API called Bugout (https://github.com/chr15m/bugout) that uses WebTorrent to set up a WebRTC connection, which is a very interesting idea. It may be worthwhile to take a look at how it works for pubsub without webrtc-star