Skip to main content

Get started with a server

Run your own IOSignal server instead of the public one (io.iosignal.net) to connect apps, boards and games. The server delivers by tag alone, so the server setup is the same whatever the application. If you are new, read core concepts in five minutes first.

1. Install​

With Node.js 22.16.0 or later, run it in one of two ways.

WayCommandWhen
Node.js codenpm install iosignal, then new Server({ port: 7777 })Putting the server in an app, or setting up authentication and hosts in code
CLInpm install -g iosignal-cli, then io-server -l 7777Starting one right away without code

2. First connection​

Start a server with Run a server, and check delivery with the receiver and sender of the five-minute quickstart.

3. What to decide on a server​

  • Ports: browsers and Node.js connect over WebSocket (port), Arduino over TCP (congPort). Open both to accept Arduino. Connections and server addresses
  • TLS: HTTPS pages need wss://. Configure a certificate on the server or a reverse proxy.
  • Authentication: accept only anonymous connections, or give fixed CIDs with device keys (a file, Redis or local test logins). The duplicate-login policy for one ID is set here too. Server authentication
  • Quotas and roles: set per-connection limits on message size, messages and bytes per second, and receivers per publish. Anonymous connections use anonymousQuota. Server API: quota
  • Watching the state: turn on a live status page with dashboard: true. Server dashboard
  • Logic inside the server: when the server must judge, as in games and quizzes, use server.host(). Game logic inside the server

4. Build guides​

What you want to doPages
Start a server from code or the CLIRun a server, CLI server
Connect from other devices and the internetConnections and server addresses
Accept logins with device keysServer authentication
Watch the state liveServer dashboard
Judge games and quizzesGet started with games, game logic inside the server
Public servers and addressesPublic servers and web apps
Every option and methodServer API

5. Before opening it to others​

  • Check the address, ports and firewall that other devices will use.
  • Prepare wss:// for HTTPS pages.
  • Set up authentication and quotas. Quotas always apply, to anonymous connections too.

6. When you are stuck​