Send from broadcaster to viewers using PubSub

Hello, I have a couple of questions:

  • Assuming there is a webserver running somewhere at foo.com
  • The twitch extension [broadcaster-side] (from the live dashboard) polls foo.com for some data
  1. Can the twitch extension [broadcaster-side] send to all twitch extension [viewer-side] such data (fetched from the server)? Does it need to go through a backend server or does send directly pass the message to all twitch extension [viewer-side]?

  2. Can foo.com be a webserver running on the broadcaster computer? (assuming he has an SSL certificate properly set up and imported in the browser for his local webserver)

It makes perfect sense for me, but would like confirmation. Reasons for not having an EBS is because it’s a private extension and user don’t want to pay monthly for it, so it’s open to “more hacky” solutions.

  1. For development you can use a local web server but that would not work in production since it exposes the broadcasters IP address (assuming they are running the app locally) and would never pass review. If you need to use a desktop application you would need to host a web service hat relays the data better extension and application.

No with how I figured the architecture, it doesn’t expose the IP to anyone:

Dashboard Livestream part of the extension (the broadcaster part) uses https and tries to load a JSON file from let’s say https://127.0.0.1:12345/data.json with a simple AJAX request. This extension is loaded in the browser, which effectively means is running only when the broadcaster’s computer and only on his browser, and interacting with the webserver installed locally.
The IP is not exposed at all, since the broadcaster browser is the only one able to access the server, which doesn’t even need to open ports or anything: both things are happening locally.

After that, is all normal: broadcaster part of the extension send messages to viewer part of the extension, that’s it.