basic-auth.any.js (493B)
1 // META: global=window,worker 2 // META: script=constants.sub.js 3 // META: variant=?wss 4 // META: variant=?wpt_flags=h2 5 6 async_test(t => { 7 const url = __SCHEME + '://' + 'foo:bar@' + __SERVER__NAME + ':' + __PORT + '/basic_auth'; 8 const ws = new WebSocket(url); 9 ws.onopen = () => { 10 ws.onclose = ws.onerror = null; 11 ws.close(); 12 t.done(); 13 }; 14 ws.onerror = ws.onclose = t.unreached_func('open should succeed'); 15 }, 'HTTP basic authentication should work with WebSockets'); 16 17 done();