solana-ws-keepalive
Solana WebSocket subscriptions that stay alive
Detects a feed that has gone silent while the socket still looks open, reconnects with backoff, and puts every subscription back. Zero dependencies.
Try it
npx github:blixvip/solana-ws-keepalive slots
What it does
- Dead-feed detection by silence
- Reconnect with backoff and jitter
- Automatic resubscribe after every reconnect
- A heartbeat for quiet subscriptions
Use it in your code
npm install github:blixvip/solana-ws-keepalive
import { createStream } from "solana-ws-keepalive";
const stream = createStream({ url, heartbeat: true });
stream.subscribe("logsSubscribe", [{ mentions: [address] }], console.log);
Full documentation, the API and the FAQ are in the README. It is MIT licensed and has no dependencies.
Guide
Why your Solana WebSocket stops receiving messages, and how to keep it alive
From the team behind Blix
solana-ws-keepalive is a small, open piece of what runs behind Blix, the AI-powered Solana memecoin terminal with 0% fees: every pump.fun launch live, AI coin ratings, narratives, wallet and X tracking, and one-click trading. If you want the result rather than the plumbing, use Blix. There is also a public API and an MCP server for AI agents.
Contribute
Pull requests are welcome and there are good first issues with step-by-step instructions. Setup is git clone and npm test. Ask anything in the Discord.