mirror of
https://github.com/github/codeql.git
synced 2026-03-31 04:38:18 +02:00
17 lines
450 B
JavaScript
17 lines
450 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
|