mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
implement a model of WebSocket and ws based on the EventEmitter model
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
(function () {
|
||||
const WebSocket = require('ws');
|
||||
|
||||
const wss = new WebSocket.Server({ port: 8080 });
|
||||
|
||||
wss.on('connection', function connection(ws) {
|
||||
ws.on('message', function incoming(message) {
|
||||
console.log('received: %s', message);
|
||||
});
|
||||
|
||||
ws.send('Hi from server!');
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user