17 lines
294 B
JavaScript
17 lines
294 B
JavaScript
const WebSocket = require('ws');
|
|
|
|
// send
|
|
|
|
const ws = new WebSocket('ws://localhost:8080/proxy/ws', {
|
|
rejectUnauthorized: false,
|
|
followRedirects : true,
|
|
});
|
|
|
|
ws.on('open', function open() {
|
|
ws.send('something');
|
|
});
|
|
|
|
ws.on('message', function incoming(data) {
|
|
console.log(data);
|
|
});
|