最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to listen to connection errors in Action Cable? - Stack Overflow

programmeradmin0浏览0评论
// 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?

发布评论

评论列表(0)

  1. 暂无评论