As the title says... Chat on...

User avatar
By GeoReb
#86612 Using NodeMCU 2.2.1 (Lua) on an ESP8266-12F

- I am creating a server and listening on port 80 for HTTP GET requests
- I then respond to a 'Connection Upgrade' from a client and then act as a Websocket server

This all works very well :)

My question is, can I serve more than 1 client simultaneously (from a web browser) on the same port?

I know that I can listen on multiple ports, like 80 and 81, and handle multiple GET requests / Websocket connections that way, but I would like to serve an HTTP request AND a Websocket client on the same port (80).

Currently, a HTTP GET request 'overwrites' a currently connected Websocket client, as you'd expect.

Please can you advise? Thankyou