elo-isomorphic-ws
v0.2.5
Published
Lightweight, cross-platform WebSocket client with Node.js headers support
Maintainers
Readme
elo-isomorphic-ws
Lightweight, cross-platform WebSocket client with Node.js headers support
Installation
npm install elo-isomorphic-wsUsage
import { WebSocket } from 'elo-isomorphic-ws';
// Works in all environments
const ws = new WebSocket('wss://echo.websocket.org', {
headers: {
Authorization: 'Bearer token', // Node.js only - ignored elsewhere
},
});Platform Support
- Node.js: Uses
wslibrary with headers support - Browsers: Uses native WebSocket (headers safely ignored)
License
MIT
