-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] - Websocket data streaming #145
base: master
Are you sure you want to change the base?
Conversation
change ln 223 of pageSwitcher.js to your local IP address var socket = await io.connect('##.#.#.##:8080'); |
Seems to be connecting to the socket now, but still can't seem to access data from terminal with nc, iocat or websocat |
Thank you for the simplification. I am unclear how to reproduce this:
What does that mean? |
Fixes to build and test socket connections. Fix: L46 in index.html was calling the socket javascript <script src="/socket.io/socket.io.js"></script> We want to use react/node to handle our package calls, especially for the server. Need to install socket.io yarn add socket.io Socket.io allows for allows synchronized communication to take place simply within your app, which means real-time communication! It is built on WebSockets, which allows synchronized bilateral exchange between the client and the server. That is, the socket requires a server and a client. Building the ServerThe server centralizes and manages the connections of the different clients who are connected to the website Building the ClientThe client connects to the server and displays results in the browser. References: |
As per: Install express yarn add express Edit the package.json so that the start script runs node and not react-scripts "start": "node server.js", Then rebuild the site. Note, with express we will have to rebuild each time. yarn build Then restart the site, and it is running with the explicit express server. Then we need to integrate Socket.IO to the server code. https://dev.to/captainpandaz/a-socket-io-tutorial-that-isn-t-a-chat-app-with-react-js-58jh io.emit('some event', { someProperty: 'some value', otherProperty: 'other value' }); // This will emit the event to all connected sockets From: https://socket.io/docs/
So, build a simple socketio client to test socket communication. |
Used a simplified version of the code and a single module as a more simple way to test the streaming,
Taking over from closed PR:
#144