mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
13 lines
262 B
TypeScript
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");
|
|
}
|
|
};
|