Files
codeql/javascript/ql/test/library-tests/frameworks/WebSocket/client.js

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