v1.0 Ready · MIT Licensed · Drop-in Pusher Protocol v7/v8

Self-hosted WebSockets & push notifications in pure Go

APS (Aadhan Pradhan Services) gives you everything Pusher Channels and Pusher Beams provide — without per-connection caps, monthly message meters, or per-device pricing. Point your existing client SDKs to your own server and run real-time events for free.

QUICKSTART IN 5 SECONDS
$docker run -p 8080:8080 -p 3000:3000 ghcr.io/khajumsanjog/aps:latest

Starts the Go WebSocket engine on port :8080 and the Developer Console on :3000. Zero config or database setup needed to test locally.

< 0.5ms
local broadcast latency
100k+
concurrent connections / node
35MB
idle RAM, single standalone binary
$0
unlimited messages & connections

The 2-Line Drop-in Migration

APS speaks the exact wire protocol of Pusher. You keep your existing client and server code, packages, and hooks — only two configuration lines change.

Why don't you need to rewrite your apps? Pusher's client-server WebSocket protocol is an open wire specification. APS implements this exact protocol (framing, handshakes, ping/pong heartbeats, and private channel HMAC authentication). Your frontend apps (React, Vue, iOS Swift, Android Kotlin, Flutter) connect with zero code rewrites.
client.js (Standard Pusher Cloud) $1,199/mo at 100k conns
import Pusher from 'pusher-js';

const pusher = new Pusher('YOUR_APP_KEY', {
-  cluster: 'mt1',
-  forceTLS: true
});

const channel = pusher.subscribe('orders');
channel.bind('order:created', (data) => {
  renderOrder(data);
});
client.js (Self-Hosted APS Engine) ~$15/mo on any VPS
import Pusher from 'pusher-js';

const pusher = new Pusher('aps_key_demo_12345', {
+  wsHost: 'aps.yourcompany.com', // Your self-hosted domain
+  wsPort: 443,                   // Handled via SSL reverse proxy
  enabledTransports: ['ws', 'wss'],
  forceTLS: true
});

const channel = pusher.subscribe('orders');
channel.bind('order:created', (data) => {
  renderOrder(data);
});

What APS Actually Does

Six core components designed to give you complete independence from third-party real-time subscription services.

01

APS Channels (WebSockets Engine)

Complete drop-in replacement for Pusher Channels. Supports public broadcast feeds, private authenticated channels with HMAC-SHA256 signatures, presence channels with real-time member online/offline state, and client-side AES-GCM encrypted payloads. Also includes an optional message replay buffer (/history) so reconnecting clients never lose messages.

public-* private-* presence-* AES-GCM encryption message history
02

APS Beams (Push Notification Daemon)

A unified push daemon that reaches mobile devices when apps are closed or asleep. Direct integration with Firebase Cloud Messaging (FCM HTTP v1) for Android & Web Push, and Apple Push Notification service (APNs) for iOS. Publish to topic interests or target authenticated user IDs directly with zero per-device fees.

FCM HTTP v1 Apple APNs topic interests user ID targeting device registration
03

Next.js 16 Developer Console

A modern web control plane included in the stack. View live streaming WebSocket events in real time, inspect connection graphs, test mobile push notifications with custom JSON payloads, rotate application keys and secrets, and review webhook delivery logs with dead-letter retries.

live event tail push testbed key rotation webhook retries Next.js 16
04

Dedicated apsctl CLI Tool

Built for terminal-first developers and automation pipelines. Run apsctl status to verify cluster node health, apsctl tail to stream live channel events directly in your terminal, apsctl trigger to send mock events, and apsctl push to test push delivery without writing custom scripts.

apsctl status apsctl tail apsctl trigger apsctl push
05

Standalone In-Memory or Clustered Scale

Two deployment architectures in a single binary:
• Standalone Mode: Uses Go's internal synchronization and channels. Zero external databases required, boots in 2ms, idles under 35MB RAM, and handles 50,000+ connections on a $5 VPS.
• Clustered Mode: Turn on Redis 7 pub/sub for multi-node event synchronization behind a load balancer, with PostgreSQL 16 for persistent app keys and webhook history.

zero-dependency mode Redis 7 pub/sub PostgreSQL 16 Docker Compose
06

Zero Custom Client SDKs Required

Because APS implements the standard Pusher wire specification, you never rely on custom, unmaintained third-party client wrappers. Use the official, production-tested Pusher client SDKs across Web, iOS (Swift), Android (Kotlin), Flutter, Python, Go, Node.js, and PHP Laravel Broadcasting.

pusher-js PusherSwift pusher-java-client pusher_channels_flutter Laravel Echo

Interactive Broadcast Simulator

Experience the sub-millisecond dispatch loop right in your browser. Send an event and watch the WebSocket log update.

How this works: When you click "Broadcast event", a simulated REST event request (POST /apps/100001/events) is dispatched. The Go hub matches active subscribers on that channel and broadcasts the framed event to all connected WebSocket clients in ~0.3ms.
aps-cluster-node-01 · wss://aps.khajumsanjog.com/app/100001
hub online, 0.4ms latency
3 events received transports: ['ws', 'wss']
public-live-orders 12:15:02 UTC · 0.38ms
{"event":"order:created","data":{"orderId":"ORD-9419","amount":"$64.00","status":"delivered"}}
chat-general 12:15:20 UTC · 0.42ms
{"event":"message:sent","data":{"user":"DevGuru","text":"APS latency is lightning fast!"}}
presence-game-lobby 12:15:45 UTC · 0.39ms
{"event":"pusher:member_added","data":{"user_id":"u_8841","info":{"name":"Elena"}}}

Code Examples by Language

Standard Pusher packages with customized host configuration. Select your stack below:

app.js — browser client via pusher-js

        

How APS Compares

An honest engineering comparison: trade a steep SaaS subscription bill for lightweight self-hosted infrastructure.

Feature / Capability APS (Self-Hosted) Pusher Channels Ably Socket.io
Monthly Connection Limits Unlimited (Hardware-bound) Strict limits per tier (200k max) Pay-per-connection Unlimited
Monthly Message Quotas Unlimited (0 limits) Metered per million Metered billing Unlimited
Pusher Protocol Compatible Yes, 100% native Yes No — requires Ably SDK No — requires Socket.io client
Mobile Push Engine (Beams) Built-in (FCM + APNs) Separate paid product Separate integration Not included
Admin Developer Console Included (Next.js 16) Cloud dashboard Cloud dashboard Not included
Terminal CLI Utility Included (apsctl) None Beta CLI None
Hosting Cost for 100k Users ~$10–20/month (VPS) $1,199+/month $1,500+/month ~$20/month, self-managed

How a Message Actually Moves

Four sequential hops from client emission to recipient delivery, explained step by step.

01 / CONNECTION

Reverse Proxy & Handshake

Web clients, mobile apps, or IoT hardware open standard WebSocket connections (wss://). A reverse proxy (Caddy or Nginx) terminates SSL/TLS on port 443 and passes the upgrade to APS on port 8080.

02 / AUTHENTICATION

HMAC Signature & Binding

For private or presence channels, the client provides an auth token computed with your app secret (HMAC-SHA256). APS verifies the signature, registers the connection, and binds it to the requested channel.

03 / FAN-OUT

Sub-Millisecond Dispatch

When your backend triggers an event, Go goroutines broadcast the payload across connected sockets in <0.5ms. In clustered mode, Redis 7 Pub/Sub immediately replicates the event to all neighboring cluster nodes.

04 / MOBILE PUSH

Asynchronous Push Queue

If the broadcast targets mobile devices via APS Beams, background worker pools deliver notifications to Google Firebase FCM (Android) and Apple APNs (iOS) asynchronously without stalling real-time WebSockets.

Download & Deployment Options

Pick the deployment path that matches your infrastructure: pre-compiled binary, Docker Compose, or Go source.

Pre-compiled Binaries

Static Go executables with zero external runtime dependencies. Download, grant execution permissions, and run.

Docker & Compose Stack

Official multi-arch container image plus a complete production Compose stack with Caddy, PostgreSQL, and Redis.

Build from Go Source & CLI

Install the apsctl control CLI directly or build the server binary locally using Go 1.26+.

Frequently Asked Questions

Practical answers to common architecture, migration, and infrastructure questions.

No. APS strictly implements the official Pusher protocol (v7/v8). Standard client libraries such as pusher-js, PusherSwift, pusher-java-client, and pusher_channels_flutter work out-of-the-box without modification. You simply configure wsHost and wsPort during client initialization.
APS Beams follows the same architectural model: client devices register their native push tokens (FCM for Android and Web, APNs for iOS) with your APS instance. Your backend server then publishes alerts targeting specific interest topics or authenticated user IDs. APS handles formatting and delivery to Apple and Google push servers without per-device pricing.
Yes. Written in Go, the standalone binary idles at under 35MB of RAM. A single 1-vCPU / 1GB RAM virtual machine (DigitalOcean droplet, Hetzner Cloud, or AWS t4g.micro) can easily sustain 20,000 to 50,000 active concurrent WebSocket connections before you need to consider clustering.
The recommended pattern is to terminate TLS at a reverse proxy like Caddy or Nginx on port 443. Caddy automatically provisions and renews free Let's Encrypt certificates. The reverse proxy forwards WebSocket upgrade requests (/app/*) and REST calls (/apps/*, /beams/*) directly to APS running locally on port 8080.
When scaling horizontally across multiple APS instances behind a load balancer, enable the Redis driver. When an event is triggered on Node A, APS publishes it to Redis 7 Pub/Sub. Nodes B and C immediately receive the message from Redis and broadcast it to their locally connected clients in under a millisecond.