mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
17 lines
447 B
JavaScript
17 lines
447 B
JavaScript
const WebSocket = require('ws');
|
|
|
|
(function () {
|
|
const ws = new WebSocket('ws://example.org'); // $clientSocket
|
|
|
|
ws.on('open', function open() {
|
|
ws.send('Hi from client!'); // $clientSend
|
|
});
|
|
|
|
ws.on('message', function incoming(data) { // $ remoteFlow
|
|
console.log(data);
|
|
}); // $clientReceive
|
|
})();
|
|
|
|
module.exports.MyWebSocketWS = require('ws');
|
|
module.exports.myWebSocketWSInstance = new WebSocket('ws://example.org'); // $ clientSocket
|