summaryrefslogtreecommitdiffstats
path: root/net/data/websocket/split_packet_check.html
blob: 6b7e980a788a7533942a8ee991b2b06bcadc657d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html>
<head>
<title>test ws split packet</title>
<script type="text/javascript">
var protocol = location.protocol.replace('http', 'ws');
var url = protocol + '//' + location.host + '/close-with-split-packet';

// Do connection test.
var ws = new WebSocket(url);

ws.onopen = function()
{
  // Close WebSocket connection once it is established.
  ws.close();
}

ws.onclose = function(event)
{
  // Check wasClean, then set proper title.
  if (event.wasClean && event.code === 3004 && event.reason === 'split test')
    document.title = 'PASS';
  else
    document.title = 'FAIL';
}

</script>
</head>
</html>