1 <title>WebSocket is not subject to HTTP(S) connection limit
</title>
3 var protocol
= location
.protocol
.replace('http', 'ws');
4 var url
= protocol
+ '//' + location
.host
+ '/echo-with-no-extension';
6 // TODO(ricea): The limit for ws: is 255, but wss: gets a limit of 30
7 // (per-host:port, not ip:port!) because it still uses the HTTP pool code. This
8 // should be fixed at some point. When it is, change this number back to 50 (or
9 // even larger, if it works).
13 for (i
= 0; i
< socketCount
; ++i
) {
14 var ws
= new WebSocket(url
);
15 ws
.onopen = function() {
17 if (connected
== socketCount
) {
18 document
.title
= "PASS";
21 ws
.onclose = function() {
22 document
.title
= "FAIL";
26 setTimeout(function() {
27 console
.log("Got stuck after " + connected
+ " socket(s) connected");
28 document
.title
= "FAIL";