npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

symple-server

v3.0.0

Published

Symple realtime messaging and presence server

Downloads

11

Readme

Symple Server

Realtime messaging and presence server built on Socket.IO.

Part of the Symple ecosystem:

Features

  • Presence — peer online/offline status broadcasting
  • Scoped messaging — direct (peer-to-peer), user-level, room-level, or global broadcast
  • Dynamic rooms — clients can join and leave rooms at runtime
  • Token authentication — session validation via Redis (or anonymous mode)
  • Horizontal scaling — optional Redis pub/sub adapter for multi-instance deployments
  • SSL/TLS — optional HTTPS support

Quick Start

git clone https://github.com/sourcey/symple-server.git
cd symple-server
npm install
npm start

The server listens on port 4500 by default. No Redis required — it runs in single-instance mode out of the box.

Configuration

All configuration is via environment variables (loaded from .env via dotenv). Copy .env.example to .env to get started.

| Variable | Default | Description | |---|---|---| | PORT | 4500 | Port to listen on (also SYMPLE_PORT) | | SYMPLE_SESSION_TTL | -1 | Session TTL in minutes (-1 = no expiry) | | SYMPLE_AUTHENTICATION | false | Require token auth (needs Redis) | | SYMPLE_DYNAMIC_ROOMS | true | Allow clients to join/leave rooms | | SYMPLE_REDIS_URL | — | Redis connection URL (enables Redis features) | | SYMPLE_REDIS_HOST | — | Redis host (alternative to URL) | | SYMPLE_REDIS_PORT | — | Redis port (alternative to URL) | | SYMPLE_CORS_ORIGINS | * (allow all) | Comma-separated origins or * | | SYMPLE_CORS_METHODS | GET,POST | Allowed HTTP methods | | SYMPLE_CORS_CREDENTIALS | — | Enable credentials (true/false) | | SYMPLE_SSL_ENABLED | false | Enable HTTPS | | SYMPLE_SSL_KEY | — | Path to SSL key file | | SYMPLE_SSL_CERT | — | Path to SSL certificate file |

Redis

Redis is optional. Without it, the server runs in single-instance mode with in-memory Socket.IO. Set SYMPLE_REDIS_URL to enable:

  • Horizontal scaling — multiple server instances via the @socket.io/redis-adapter
  • Token authentication — session lookup at symple:session:<token>
  • Server-side emission — push messages from Ruby/Rails via symple-client-ruby

Authentication

When SYMPLE_AUTHENTICATION=true, clients must provide user and token in the Socket.IO handshake auth. The server looks up the session in Redis at symple:session:<token> and merges it with the auth data.

When SYMPLE_AUTHENTICATION=false (default), clients only need to provide user.

Message Routing

Messages are routed based on the to field:

| to value | Behavior | |---|---| | Undefined | Broadcast to joined rooms (or globally if dynamicRooms is off) | | "user\|id" | Direct message to a specific peer | | ["room1", "room2"] | Broadcast to multiple rooms |

Programmatic Usage

const Symple = require('./lib/symple');
const { createConfig } = require('./config');

const config = createConfig();
const server = new Symple(config);

// Override the post-auth hook
server.onAuthorize = function(socket) {
  console.log('Peer connected:', socket.peer.name);
};

server.init();

Debug Logging

Enable debug output with:

DEBUG=symple:* npm start

License

MIT