JSFiddle - React, Tailwind, and code Playground

by Andres Abadia

JavaScript

var websocket = new WebSocket("wss://4snfv0z2ih.execute-api.us-east-1.amazonaws.com/audiochat");

websocket.onopen = function (event) {
console.log("connection successful",event);
  websocket.send({action:"sendmessage",data:"some test"}); 
  websocket.send("somethig to the default route"); 
};

websocket.onmessage = function (event) {
  console.log("message recieved",event.data);
}