unplugged-system/external/cronet/net/data/websocket/connect_check_worker.js

9 lines
268 B
JavaScript

onmessage = () => {
var protocol = location.protocol.replace('http', 'ws');
var url = protocol + '//' + location.host + '/echo-with-no-extension';
var ws = new WebSocket(url);
ws.onopen = () => postMessage('PASS');
ws.onclose = () => postMessage('FAIL');
}