const socket = new WebSocket('wss://scrapbox.io/socket.io/?EIO=4&transport=websocket'); socket.addEventListener('open', e => console.info(e)); socket.addEventListener('message', e => console.log(e)); socket.addEventListener('error', e => console.error(e)); socket.addEventListener('close', e => console.info(e));