Reading the repo
Reading the repo
How to install on Windows
The WebSocket Relay Server for the Socket SDK in dglab-kit.
Saved setup from 6 h ago
Will it work on my device?
Then run powershell -ExecutionPolicy Bypass -File .\setup.ps1. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: winget install Git.Git
git clone https://github.com/dungeonlab-open/dglab-websocket-server.git cd dglab-websocket-server
Node.js LTS (no version pinned), Bun
winget install CoreyButler.NVMforWindows nvm install lts nvm use lts powershell -c "irm bun.sh/install.ps1 | iex"
Copy-Item .env.example .env
bun install
bun run v4
The server listens on the following address by default:
ws://127.0.0.1:9998
Connect with dglab-kit:
import { DglabSocket } from 'dglab-kit';
const socket = new DglabSocket({ url: 'ws://127.0.0.1:9998' });
const { targetId } = await socket.connect();
console.log('Pairing ID for app clients:', targetId);
An app client can connect to a specific controller by including its ID in the tid query parameter:
ws://127.0.0.1:9998?tid=<controller-client-id>
You can also generate a Socket Control QR code for the DG-LAB 4 app:
const qrcode = `https://dungeon-lab.cn/s/?v=1&action=socket&url=${encodeURIComponent('ws://127.0.0.1:9998?tid=' + targetId)}`;
bun run v3
The server listens on the following address by default:
ws://127.0.0.1:9999
Connect with dglab-kit:
import {
DGLAB_SOCKET_VERSION,
DglabSocket,
V3Channel,
} from 'dglab-kit';
const socket = new DglabSocket({
version: DGLAB_SOCKET_VERSION.V3,
url: 'ws://127.0.0.1:9999',
});
const { targetId } = await socket.connect();
console.log('Share this controller ID with the app client:', targetId);
socket.on('client-attached', () => {
socket.setStrength(V3Channel.A, 20);
});
bun run dev:v4
bun run dev:v3
No reports for Windows yet.
Opens a chat with this manual already filled in, for Windows. It uses your own account; gitmanual sends nothing.