The best open source alternative to Pubnub is GUN, which is both free and Open Source. If that doesn't suit you, our users have ranked more than 50 alternatives to Pubnub and 16 is open source so hopefully you can find a suitable replacement. Other interesting open source alternatives to Pubnub are Supabase (Free, Open Source), MongooseIM platform (Free, Open Source), deepstream.io (Free, Open Source) and Koa (Free, Open Source).
MongooseIM is aimed at large, complex enterprise level projects, where real-time communication is critical for business success. It provides high availability, ease of deployment, development and reliability in production.
deepstream.io is a clusterable realtime server that handles persistent tcp and websocket connections. It offers data-sync, pub/sub and request/response. It's available for Linux, Mac and Windows and comes with clients in JS, Java and many others.
Expressive middleware for node.js using generators via co to make web applications and APIs more enjoyable to write. Koa's middleware flow in a stack-like manner allowing you to perform actions downstream, then filter and manipulate the response upstream.