webtty-terminal
v5.0.0
Published
Web-based terminal emulator with SSH support, connection manager, multi-session tabs. Powered by xterm.js, node-pty, ssh2, and Socket.IO.
Maintainers
Readme
WebTTY Terminal
Access your terminal from any browser using xterm.js, node-pty, and Socket.IO.
Installation
npm install -g webtty-terminalQuick Start
# Start with default settings (port 8080, bash)
webtty
# Start with custom port
webtty --port 3000
# Start with authentication
webtty --user admin --password secret
# Read-only mode
webtty --read-only
# Custom shell
webtty --shell /bin/zsh
# Custom working directory
webtty --cwd /home/user/projectsOptions
| Option | Description | Default |
|--------|-------------|---------|
| -p, --port | Server port | 8080 |
| -s, --shell | Shell path | $SHELL or /bin/bash |
| -c, --cwd | Working directory | $HOME |
| -u, --user | Basic auth username | None |
| -w, --password | Basic auth password | None |
| --read-only | Disable keyboard input | false |
| --max-clients | Max concurrent clients | 10 |
Authentication
When using auth, pass credentials via URL query:
http://localhost:8080/?user=admin&pass=secretProgrammatic Usage
const WebTTYServer = require('webtty-terminal')
const server = new WebTTYServer({
port: 8080,
shell: '/bin/bash',
credentials: { username: 'admin', password: 'secret' },
readOnly: false,
maxClients: 10,
})
server.start()Requirements
- Node.js >= 18
- Supported OS: Linux, macOS, Windows
License
MIT
