Skip to content

A modern SSH port forwarding management tool with an elegant web interface and comprehensive API support.一个现代化的SSH端口转发管理工具,提供美观的Web界面和丰富的API接口

Notifications You must be signed in to change notification settings

SonglinLife/sstunnel-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSHTunnel Web

简体中文 | English

A modern SSH port forwarding management tool with a beautiful web interface and comprehensive API.

SSHTunnel Web Interface

Version License Node

✨ Features

  • 🚀 Modern Interface - Responsive design for desktop and mobile devices
  • 📋 Configuration Management - Auto-parse SSH config files (~/.ssh/config format)
  • 🔄 Persistent Storage - Auto-restore port forwarding settings after restart
  • Real-time Monitoring - Display connection status and duration
  • 🔌 Rich API - Complete REST API support
  • 🛡️ Secure & Reliable - SSH key-based authentication
  • 📊 Status Management - Detailed connection management and error handling

🚀 Quick Start

Installation

  1. Clone the repository:
git clone https://github.com/SonglinLife/sstunnel-web.git
cd sstunnel-web
  1. Install dependencies:
npm install
  1. Prepare SSH configuration file:
# Copy your SSH config or create a new one
cp ~/.ssh/config ./ssh-config

Usage

  1. Start the server:
npm start                    # Default port 7432
npm start -- --port 8080    # Custom port
npm start -- --help         # Show help
  1. Open your browser and navigate to:
http://localhost:7432
  1. Select SSH host, set local and remote ports, and start port forwarding!

📁 SSH Configuration Format

SSH config file should follow standard ~/.ssh/config format:

Host production-server
    HostName prod.example.com
    User admin
    Port 22
    IdentityFile ~/.ssh/prod_key

Host development-server
    HostName 192.168.1.100
    User developer
    Port 22
    IdentityFile ~/.ssh/id_rsa

🔌 API Endpoints

Core Endpoints

  • GET /api/health - Health check
  • GET /api/status - System status
  • GET /api/ssh-configs - Get SSH configuration list

Port Forwarding Management

  • POST /api/forward - Create port forwarding
  • GET /api/connections - Get active connections
  • DELETE /api/forward/:key - Stop specific forwarding
  • DELETE /api/connections - Stop all forwarding

Utility Endpoints

  • GET /api/ports/check/:port - Check port availability
  • POST /api/test-ssh - Test SSH connection

API Usage Examples

# Create port forwarding
curl -X POST http://localhost:7432/api/forward \
  -H 'Content-Type: application/json' \
  -d '{"host":"production-server","localPort":8080,"remotePort":80}'

# Get active connections
curl http://localhost:7432/api/connections

# Stop all forwarding
curl -X DELETE http://localhost:7432/api/connections

🎯 Use Cases

  • Local Development - Forward remote database ports to local
  • Service Debugging - Access internal services on remote servers
  • Secure Access - Safely access remote resources through SSH tunnels
  • Team Collaboration - Centralized SSH port forwarding management

⭐ Core Features

Persistent Storage

  • Auto-save port forwarding configurations
  • Auto-restore forwarding after server restart
  • Batch management and cleanup support

Smart Error Handling

  • Port occupation detection and prompts
  • SSH connection status monitoring
  • Detailed error messages and solutions

Modern Interface

  • Gradient backgrounds and glassmorphism effects
  • Real-time status updates
  • Mobile-responsive design

🛠️ Tech Stack

  • Backend: Node.js + Express
  • SSH: ssh2 library
  • Frontend: Vanilla JavaScript + Modern CSS
  • Configuration: SSH Config Parser

📋 Requirements

  • Node.js 14.0+
  • SSH key configuration
  • SSH access to target servers

🔧 Development

Start development mode (auto-reload):

npm run dev

📄 License

This project is licensed under the MIT License.

🤝 Contributing

Issues and Pull Requests are welcome!

  1. Fork this repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

🐛 Bug Reports

If you find any issues, please submit them on the Issues page.

📧 Contact

For questions, please contact us through GitHub Issues.


SSHTunnel Web - Making SSH port forwarding simple and elegant ✨

About

A modern SSH port forwarding management tool with an elegant web interface and comprehensive API support.一个现代化的SSH端口转发管理工具,提供美观的Web界面和丰富的API接口

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •