webssh
v1.0.1
Published
Web-based SSH terminal server and client with xterm.js integration
Maintainers
Readme
webssh
Web-based SSH terminal server and client with xterm.js integration. Access remote shells through your browser or CLI.
Features
- 🌐 Browser-based terminal – Full xterm.js integration with syntax highlighting and themes
- 🔌 WebSocket transport – Real-time bidirectional communication
- 🖥️ CLI client – Connect from command line with interactive prompt
- 📏 Auto-resize – Terminal dimensions sync between client and server
- 🔒 Session management – Unique session IDs with automatic cleanup
- ⚡ Lightweight – Minimal dependencies, fast startup
- 🚀 Modern ES modules – Native ESM with async/await support
Installation
npm install webssh
#server mode
import webssh from 'webssh';
// Using async IIFE for top-level await
const { serve } = webssh;
const server = serve({
port: 3000,
host: 'localhost'
});
server.start(() => {
console.log('🚀 WebSSH server running at http://localhost:3000');
});
#client mode
import webssh from 'webssh';
const { connect } = webssh;
// Connect with defaults (localhost:3000)
await connect();
// Or specify custom host/port
await connect('remote.server.com', 8080);