mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
24 lines
624 B
JavaScript
24 lines
624 B
JavaScript
const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js');
|
|
|
|
(function () {
|
|
const ws = new MyWebSocketWS('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
|
|
})();
|
|
|
|
(function () {
|
|
myWebSocketWSInstance.on('open', function open() {
|
|
myWebSocketWSInstance.send('Hi from client!'); // $ clientSend
|
|
});
|
|
|
|
myWebSocketWSInstance.on('message', function incoming(data) { // $ remoteFlow
|
|
console.log(data);
|
|
}); // $ clientReceive
|
|
})();
|