Skip to content

alexandrglm/websocket-shell-react

Repository files navigation

WebShell - Secure Terminal Access via Browser

A secure, web-based terminal emulator built with React and Socket.IO.

main


🚀 Quick Start

Frontend: React 18, Redux Toolkit, Socket.IO Client, Vite, SCSS
Backend: Node.js, Express, Socket.IO, JWT, Bcrypt, node-pty

Installation

git clone https://github.com/alexandrglm/websocket-shell-react.git
cd websocket-shell-react

npm install

Environment Setup

Create .env file:

JWT_SECRET=a-secret-token
SHELL_HASHWORD=$2b$10$your-hashed-password
WEBSHELL_SERVER_PORT=3001
VITE_SHELL_URI=http://localhost:3001
REACT_APP_SHELL_URI=http://localhost:3001

Generate password hash:

node .tools/hashpass.js your-password

Run

# Development
node server
npm run start

# Production
npm run build
node server

Access: http://localhost:7777


🎨 Interface

Terminal Window

UI Themes

Header Controls

  • 🔴 Close - Disconnect session
  • 🟡 Minimise - Exit fullscreen
  • 🟢 Maximise - Enter fullscreen

Status Indicator (click to open menu):

  • ● Green - Connected
  • ● Red - Disconnected

Application Menu

Options

  1. Login - Authenticate for full access
  2. Session Info - View session details
  3. Themes - 5 built-in themes (Default, Light, Ubuntu, Minimal, Monokai)
  4. Help - Keyboard shortcuts & commands
  5. About - Project information
  6. Exit - Disconnect

UI Themes Selector

Modals

Authentication UI auth

Help

UI help

About

UI About


⌨️ Keyboard Shortcuts

Key Action
/ Navigate command history
Enter Execute command
Ctrl+D Send EOF / Cancel command

🔒 Security

  • Guest Mode: Limited commands (ls, pwd, whoami, date, uptime, help, clear)
  • Authenticated: Full system access
  • IP Lockout: 3 failed attempts = 5min block
  • Rate Limiting: 3 req/s (guest) / 20 req/s (authenticated)

API Endpoints

Status

GET /status

Authentication

POST /auth/validate
Content-Type: application/json

{ "password": "your-password" }

📄 Licence

MIT

Built by @alexandrglm

About

React-based WebShell for real-time server shell access on Render, Heroku, and related free-tier platforms without native shell access.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors