This is a base code for testing websocket connection between python flask with socketio as Server and react Webapp as client
Run pip install -r requirements.txt
under root folder
Run python server.py
(localhost:5000)
Go to socketapp and open CMD, then run npm install
Type npm start
The data sent from python server is being displayed in the browser
Click on "Start/Stop" to start or stop sending data from the server
## Requirements Requires Python 3+
npm i socket.io-client
pip install Flask-SocketIO
pip install gevent-websocket
Please pay attention to socketio version if you get any issues like "http://localhost:3000 is not an accepted origin Access to XMLHttpRequest at 'http://localhost:5001/socket.io/?EIO=3&transport=polling&t=NY2-yMT' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. index.js:83 GET http://localhost:5001/socket.io/?EIO=3&transport=polling&t=NY2-yMT net::ERR_FAILED"