const wsURL = "wss://127.0.0.1/";
const wss = new WebSocketStream(wsURL);
setTimeout(() => {
wss.close({
closeCode: 1000,
reason: "That's all folks",
});
}, 10000);WebSocketStream: close() method / notebook
WebSocketStream: close() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.