douyu-socketio

Local Socket.IO relay server for DouyuTV comments.

Usage no npm install needed!

<script type="module">
  import douyuSocketio from 'https://cdn.skypack.dev/douyu-socketio';
</script>

README

douyu-bridge-socket.io

Local Socket.IO relay server for DouyuTV comments.

Install

npm install douyu-socketio

Supported platforms

This library has been tested with:

  • IO.js v2.5.0

Example Usage

  1. Create relay server script as index.js

    var DouyuSocketIO = require('douyu-socketio');

    new DouyuSocketIO( "431972", // Room ID 8000, // HTTP Port null, // Web Requests Handler [ // Names of events that will be dispatched to audiences 'chatmsg', // Chat message 'dgb', // Gift notices 'uenter', // User enter 'ranklist', // Rank list 'spbc' // In-room gift notices ] ).start();

  2. Run relay servet script

    node index.js

  3. Create an HTML file and put it on local web server

    DouyuTV SocketIO Relay Server Test

    DouyuTV SocketIO Relay Server Test

  4. Visit this web page