{TametheBots}

webSocket API

The Result:

WebSocket Support? Undetermined

onopen? It fails

onmessage? It fails

Testing if Googlebot can use the webSocket api. There is a script before the closing </body> tag that connects to a test Websocket Server:

<script>
if ('WebSocket' in window || 'MozWebSocket' in window) {
     document.getElementById('support').innerHTML = 'Yes';
} else {
	document.getElementById('support').innerHTML = 'No';
}
const url = 'wss://ws.tamethebots.com/ws'
const connection = new WebSocket(url)

connection.onopen = () => {
	document.getElementById('sending').innerHTML = 'Onopen OK';
  connection.send(JSON.stringify({testing: "yes"}));
}

connection.onerror = (error) => {
 let strError = JSON.stringify(error, ["message", "arguments", "type", "name"]);
 document.getElementById('result').innerHTML = `WebSocket error: ${strError}`;
	console.log(error);
}

connection.onmessage = (e) => {
  
  document.getElementById('result').innerHTML = e.data;
}
</script>
      

< Back