Example of using WebSocket to create a simple peer chat program.
To use the example you must already have Node.js installed.
- Clone this repository to your development environment.
- Open a console window and execute the following:
(cd service && npm install) npm install - Start the backend in VS Code
- Open the project in VS Code
- Open the
service/service.jsfile. - Press
F5to start debugging. Choose Node.js as the debugging target.
- Start the backend running from a console window
- Change directory into the project root.
- Run
npm run dev.
- Use websocket chat
- Open two web browser windows to
http://localhost:5173. - Start using the chat interface to send messages between the windows.
- Open two web browser windows to