https://github.com/bowmans-dev/node_js_websocket
https://github.com/bowmans-dev/node_js_websocket
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bowmans-dev/node_js_websocket
- Owner: bowmans-dev
- Created: 2022-12-27T08:21:43.000Z (over 3 years ago)
- Default Branch: library
- Last Pushed: 2023-01-06T23:43:25.000Z (over 3 years ago)
- Last Synced: 2025-02-09T23:14:26.390Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Websocket using Node JS -
https://github.com/hnasr/javascript_playground/tree/master/websocket-demo
### https://www.youtube.com/watch?v=2Nt-ZrNP22A
### To set up locally run:
```
npm i
```
### To initialize a new websocket connection and begin receiving messages from the server
### Enter the following in your browser dev-tools console:
```
ws = new WebSocket("ws://localhost:8080");
```
```
ws.onmessage = message => console.log(`Received: ${message.data}`);
```
- Use connection.send to send stuff to the client using the debugger command line:
```
connection.send("Hello client from the server");
```