Create-blocked-port.any.js (2154B)
1 // META: script=constants.sub.js 2 // META: variant=?default 3 // META: variant=?wss 4 // META: variant=?wpt_flags=h2 5 6 async_test(t => { 7 const ws = CreateWebSocketWithBlockedPort(__PORT) 8 ws.onerror = t.unreached_func() 9 ws.onopen = t.step_func_done() 10 }, 'Basic check'); 11 // list of bad ports according to 12 // https://fetch.spec.whatwg.org/#port-blocking 13 [ 14 0, 15 1, // tcpmux 16 7, // echo 17 9, // discard 18 11, // systat 19 13, // daytime 20 15, // netstat 21 17, // qotd 22 19, // chargen 23 20, // ftp-data 24 21, // ftp 25 22, // ssh 26 23, // telnet 27 25, // smtp 28 37, // time 29 42, // name 30 43, // nicname 31 53, // domain 32 69, // tftp 33 77, // priv-rjs 34 79, // finger 35 87, // ttylink 36 95, // supdup 37 101, // hostriame 38 102, // iso-tsap 39 103, // gppitnp 40 104, // acr-nema 41 109, // pop2 42 110, // pop3 43 111, // sunrpc 44 113, // auth 45 115, // sftp 46 117, // uucp-path 47 119, // nntp 48 123, // ntp 49 135, // loc-srv / epmap 50 137, // netbios-ns 51 139, // netbios-ssn 52 143, // imap2 53 161, // snmp 54 179, // bgp 55 389, // ldap 56 427, // afp (alternate) 57 465, // smtp (alternate) 58 512, // print / exec 59 513, // login 60 514, // shell 61 515, // printer 62 526, // tempo 63 530, // courier 64 531, // chat 65 532, // netnews 66 540, // uucp 67 548, // afp 68 554, // rtsp 69 556, // remotefs 70 563, // nntp+ssl 71 587, // smtp (outgoing) 72 601, // syslog-conn 73 636, // ldap+ssl 74 989, // ftps-data 75 990, // ftps 76 993, // ldap+ssl 77 995, // pop3+ssl 78 1719, // h323gatestat 79 1720, // h323hostcall 80 1723, // pptp 81 2049, // nfs 82 3659, // apple-sasl 83 4045, // lockd 84 4190, // sieve 85 5060, // sip 86 5061, // sips 87 6000, // x11 88 6566, // sane-port 89 6665, // irc (alternate) 90 6666, // irc (alternate) 91 6667, // irc (default) 92 6668, // irc (alternate) 93 6669, // irc (alternate) 94 6679, // osaut 95 6697, // irc+tls 96 10080, // amanda 97 ].forEach(blockedPort => { 98 async_test(t => { 99 const ws = CreateWebSocketWithBlockedPort(blockedPort) 100 ws.onerror = t.step_func_done() 101 ws.onopen = t.unreached_func() 102 }, "WebSocket blocked port test " + blockedPort) 103 })