admin管理员组

文章数量:1344645

// Create WebSocket connection
const socket = new WebSocket("ws://localhost:8080");

// Listen for possible errors
socket.addEventListener("error", (event) => {
  console.log("WebSocket error: ", event);
});

In this way I connect to Action Cable server:

import { createConsumer } from '@rails/actioncable'

export default createConsumer()

How to listen to connection errors in a similar way?

本文标签: javascriptHow to listen to connection errors in Action CableStack Overflow