Registry / devops / websocket-to-tcp

websocket-to-tcp

JSON →
library0.5.2jsnpmunverified

CLI tool that creates a server to accept WebSocket connections and forward them to a TCP socket. Version 0.5.2, with infrequent releases. Supports single or multiple tunnels (via wstcpm), optional sub-protocol naming, string mode for non-binary WebSocket servers, and SSL/TLS. Designed for emulated retro computing (e.g., Commodore 64 BBS) but usable for generic TCP-over-WebSocket proxying. Minimal dependencies; pure Node.js.

npm install websocket-to-tcp
INSTALL
IMPORT
SIG · WEBSOCKET-TO-TCP
W
websocket-to-tcp
devopsjavascriptv0.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli (wstcp)
✓ npm i -g websocket-to-tcp && wstcp -t host -p port -w wsport
✗ Using require('websocket-to-tcp') as a library (it is CLI-only)
Package exposes no programmatic API; only CLI via global install.

Installs the tool globally and creates a tunnel from WebSocket port 8080 to bbs.sblendorio.eu:6510 with sub-protocol 'bbs'.

npm install -g websocket-to-tcp wstcp -t bbs.sblendorio.eu -p 6510 -w 8080 -n bbs # Then connect via WebSocket to ws://localhost:8080 with sub-protocol 'bbs'
Debug
Known issues
gotchaThe CLI name is `wstcp` (singular) and `wstcpm` (multiple tunnels), not `websocket-to-tcp`.
fix
Use `wstcp` for single tunnel, `wstcpm` for multi-tunnel config.
affects: >=0.1
gotchaThe sub-protocol name must match exactly on the client side; otherwise connection fails silently.
fix
Ensure client WebSocket uses the same protocol name as the `-n` argument.
affects: >=0.1
deprecatedNo version information available, but package has not been updated since initial release; may lack modern WebSocket features.
fix
Consider alternatives like `websocat` or custom Node.js proxy for more features.
affects: 0.5.2
Errors
Common errors & fixes
Error: listen EADDRINUSE :::<port>
The specified WebSocket port is already in use by another process.
fix
Choose a different port with `-w <newport>` or kill the process using that port.
Error: connect ECONNREFUSED <host>:<port>
TCP destination refused connection (host down, wrong port, firewall).
fix
Verify TCP server is running and accessible from your machine.
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies
wsrequiredWebSocket server implementation
yargsrequiredCommand-line argument parsing
Agent activity
15 hits · last 30 days
node
14
Resources
websocket-to-tcp — npm install websocket-to-tcp · libregistry