Reputation: 22962
We have a proprietary template format for rendering articles. We have written an editor in HTML for editing this. While editing/writing the template we want a live preview of the results directly on different iOS and android devices through a custom app we've made to preview.
It seems redundant to have a server in between the browser and the preview-app if it is possible for the browser to connect directly and have multiple sockets to the devices.
So I guess the question really is about the browser as the preview-app will most likely have no problem with this setup.
Upvotes: 1
Views: 160
Reputation: 129
Basic sockets:
an IP address bound to a socket with a 'listener' at the other end on that socket.
One App talking to multiple 'pseudo-devices' only requires control of the ip:port for each device.
Obviously, a public implementation would require firewall tweaks, but for an in-house development, anything on the same subnet would usually be immune from FW setups.
As for DNS: punt; use address reservations for the smartphones to be used used in the testing harness.
I read your issue to be dynamic testing in real-time of an html template with a preview system on real devices in-house. If not -- please excuse me.
Upvotes: 1
Reputation: 707238
If the HTML editor is in the browser and the app is on the smartphone, then it is unlikely that you can connect directly from a browser to a smartphone.
From the browser, you only have two connection options: an Ajax request or a webSocket. And, you need to be able to connect to either a public DNS name or a known IP address that is configured for incoming connections. A smartphone would not have either a public DNS name or a known IP address.
If you tried to make the connection the other way from the smartphone apps to the browser, you simply can't do that. Browser web pages don't accept incoming connections and are usually behind a firewall that would block incoming http connections anyway.
This is why two endpoints like this usually get connected via some sort of intermediary server or at least use an intermediary server to facilitate the connection.
Upvotes: 1