xref: /aosp_15_r20/external/cronet/net/data/websocket/connect_and_be_observed.html (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1<!doctype html>
2<title>This tab will have its connection observed</title>
3<script>
4'use strict';
5
6let protocol = location.protocol.replace('http', 'ws');
7let url = protocol + '//' + location.host + '/close-observer?role=observed';
8
9window.ws = new WebSocket(url);
10ws.onopen = () => {
11  document.title = 'CONNECTED';
12  ws.onclose = null;
13};
14ws.onclose = () => {
15  document.title = 'CLOSED';
16};
17
18// Leave the connection open.
19</script>
20