Files
bun.sh/test/bun.js/websocket-subprocess.ts
Dylan Conway 44c6ce11c4 fix websocket hang (#1910)
* ref and deref, and some tests

* subprocess file

* remove deref

* use flag in test
2023-01-26 18:26:05 -08:00

13 lines
262 B
TypeScript

const hostname = process.argv[2];
const port = process.argv[3];
const host = port ? `http://${hostname}:${port}` : hostname;
const ws = new WebSocket(host);
ws.onmessage = (message) => {
if (message.data == "hello websocket") {
ws.send("hello");
}
};