finds.dev← search

// the find

sockjs/sockjs-client

★ 8,517 · JavaScript · MIT · updated Jun 2026

WebSocket emulation - Javascript client

SockJS-client is the browser-side half of the SockJS protocol — it wraps WebSocket with a fallback ladder (xhr-streaming, eventsource, htmlfile, jsonp-polling) so real-time connections work even behind corporate proxies or on older browsers. You need the matching SockJS server; this library alone does nothing. The target audience is anyone who can't guarantee WebSocket availability in their deployment environment.

The transport fallback chain is genuinely thorough — it handles XDomainRequest for IE 8/9, iframe-based transports for cross-domain edge cases, and jsonp-polling as a last resort, all behind a single WebSocket-compatible API. The protocol spec is versioned (0.3), so client and server compatibility is explicit rather than implicit. The one-connection-per-domain constraint is documented honestly rather than quietly broken. TypeScript definitions ship in the dist folder, which saves time when integrating into a typed codebase.

The build toolchain is Gulp plus Browserify — both essentially abandoned in 2024 — and there is no ESM-native build path despite a dist/sockjs-esm.js file that appears to be a manual artifact. The last meaningful feature work was years ago; the repo is in maintenance mode and the ecosystem has largely moved on to native WebSockets or Socket.IO. The one-SockJS-connection-per-domain limit is a real operational foot-gun in SPAs with multiple real-time features. Server-side options are fragmented across a dozen community-maintained ports of varying quality and abandonment.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →