Debian Codegraph @

testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js

raw
1 window.addEventListener("DOMContentLoaded", () => {
2 const uri = `ws://token:${token}@localhost:8004/`;
3 const websocket = new WebSocket(uri);
4
5 websocket.onmessage = ({ data }) => {
6 // event.data is expected to be "Hello <user>!"
7 websocket.send(`Goodbye ${data.slice(6, -1)}.`);
8 };
9
10 runTest(websocket);
11 });