Registry / devops / websocket-ssh-bridge

websocket-ssh-bridge

JSON →
library1.0.3jsnpmunverified

Bridges TCP connections through a WebSocket server, commonly used to tunnel SSH over WebSocket. The package provides three command-line tools: server.js (exposes a local TCP port via WebSocket), client.js (connects a local TCP client to a remote WebSocket endpoint), and pipe.js (maps stdio to a WebSocket for use as an SSH ProxyCommand). It enables SSH through firewalls that only allow HTTP/HTTPS traffic. Current stable version is 1.0.3, released in 2016 with no active development. Key differentiators: lightweight, no dependencies besides Node.js built-ins and ws WebSocket library, simple deployment via screen/cron, and support for Apache reverse proxy.

npm install websocket-ssh-bridge
INSTALL
IMPORT
SIG · WEBSOCKET-SSH-BRID
W
websocket-ssh-bridge
devopsjavascriptv1.0.3
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.

server.js
✓ node server.js 8022 127.0.0.1 22
✗ node server.js
CLI script; does not export a module.
client.js
✓ node client.js 8022 ws://remotehost/
✗ node client.js ws://remotehost/ 8022
CLI script; arguments order: localport websocketpath.
pipe.js
✓ node pipe.js ws://remotehost/
✗ node pipe.js
CLI script; requires WebSocket path as argument.

Installs globally, starts a WebSocket server bridging port 8022 to SSH, then connects a client from another machine.

npm install -g websocket-tcp-bridge # Start server (maps local port 8022 to localhost:22) server.js 8022 &>> /tmp/ws-server.log & # Then from another machine, connect using client.js client.js 2222 ws://example.com/ & ssh -p 2222 user@localhost
Debug
Known issues
breakingThe package is abandoned; no updates since 2016. It uses the deprecated 'ws' v1.x API and Node.js pre-ESM patterns.
fix
Consider alternative packages like 'websocat' or 'wstunnel' that are actively maintained.
affects: >=1.0.0
deprecatedThe command-line scripts are CommonJS modules using `require('ws')` but do not properly handle newer Node.js features. They will fail on Node.js >=22 if not run with `--experimental-require-module`.
fix
Use Node.js 18 or lower, or run with `--experimental-require-module` flag.
affects: >=1.0.0
gotchaThe 'ws' library version used (^1.0.0) has known security vulnerabilities (CVE-2016-1000238, DoS).
fix
Do not use in production; or manually update 'ws' to >=3.3.0 but may break the bridge logic.
affects: >=1.0.0
gotchaThe scripts use deprecated `new Buffer()` which is unsafe and removed in Node.js >=10.0.0.
fix
Replace with `Buffer.from()` in source code, but since package is abandoned, better to switch to an alternative.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'ws'
The package depends on 'ws' but it may not be installed if npm install --no-optional or in a broken node_modules.
fix
Run `npm install ws` explicitly or reinstall the package with `npm install websocket-tcp-bridge`.
SyntaxError: Unexpected token '??'
The package uses a Node.js version that does not support nullish coalescing (??), e.g., Node.js 12 or lower.
fix
Use Node.js >=14.
ReferenceError: Buffer is not defined
The scripts assume a global Buffer which is not available in some bundlers or custom environments.
fix
Make sure to run with Node.js, not in a browser environment.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
wsrequiredWebSocket client/server implementation used in all scripts
Agent activity
10 hits · last 30 days
node
10
Resources
websocket-ssh-bridge — npm install websocket-ssh-bridge · libregistry