Reading the repo
Reading the repo
How to install on macOS
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 bash setup.sh. 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: xcode-select --install
git clone https://github.com/dungeonlab-open/dglab-websocket-server.git cd dglab-websocket-server
Node.js LTS (no version pinned), Bun
# needs nvm: brew install nvm (or https://github.com/nvm-sh/nvm) nvm install --lts curl -fsSL https://bun.sh/install | bash
cp .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 macOS yet.
Opens a chat with this manual already filled in, for macOS. It uses your own account; gitmanual sends nothing.