Is this scenario possible, and if not, how to make it possible?
Assume I have nodejs running on port 8080. I also have Apache running on port 80.
On the nodejs port, I have express with socketIO.
On Apache, I have a index.html webpage with a textbox with a submit button that includes “socket.io-client.js”. Entering a message in the textbox and hitting submit would pass the message over to the nodejs on port 80 that would effectively broadcast the message to all other users who have their page open at the index.html hosted on the apache.
From the examples I’ve seen so far, socketio, the webpage, express, all have to reside with wherever node is, so that the index.html page can include the script “/socketio/socket.io.js”. Is there some way I could include the socket.io.js script hosted on a server outside of nodejs? If any example or configuration available that would be needed for this to work would be helpful.
You can simple include socket.io.js in your index.html by specifying node.js port in srcipt URL like: