How to use the bilibili-live-ws.LiveTCP function in bilibili-live-ws

To help you get started, we’ve selected a few bilibili-live-ws examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dd-center / SuperSpider / packages / superspider-predb / utils / rws.js View on Github external
new Promise((resolve) => {
    // console.log(`OPEN: ${roomid}`)
    const live = new LiveTCP(roomid)
    rooms[roomid] = live
    let lastHeartbeat = 0
    const autorestart = setTimeout(() => {
      // console.log(`AUTORESTART: ${roomid}`)
      live.close()
    }, 1000 * 60 * 60 * 18)
    let timeout = setTimeout(() => {
      if (new Date().getTime() - lastHeartbeat > 1000 * 30) {
        // console.log(`TIMEOUT: ${roomid}`)
        live.close()
      }
    }, 1000 * 45)
    live.once('live', () => {
      // console.log(`READY: ${roomid}`)
    })
    live.on('LIVE', () =>

bilibili-live-ws

Bilibili Live WebSocket/TCP API

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Popular bilibili-live-ws functions