diff options
Diffstat (limited to 'testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js')
-rw-r--r-- | testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js b/testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js new file mode 100644 index 0000000000..1dab2ce4c1 --- /dev/null +++ b/testing/web-platform/tests/tools/third_party/websockets/experiments/authentication/user_info.js @@ -0,0 +1,11 @@ +window.addEventListener("DOMContentLoaded", () => { + const uri = `ws://token:${token}@localhost:8004/`; + const websocket = new WebSocket(uri); + + websocket.onmessage = ({ data }) => { + // event.data is expected to be "Hello <user>!" + websocket.send(`Goodbye ${data.slice(6, -1)}.`); + }; + + runTest(websocket); +}); |