aboutsummaryrefslogtreecommitdiff
path: root/examples/node/client.mjs
blob: 2a10d1e8a8eaafec9cc3878705884ddfc34f654a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import WebSocket from 'ws';

const u = 'wss://localhost:4443';
//const u = 'ws://localhost:3000';

const ws = new WebSocket(u, {
  rejectUnauthorized: false,
});

ws.on('open', () => ws.send('something'))
ws.on('message', msg => console.log('received: %s', msg))