A multi-tenant remote shell platform built with Go that dynamically provisions isolated Docker containers per session and provides full terminal access over TCP connections.
-
๐ Multi-Tenant Architecture
Handles multiple client sessions simultaneously, each in an isolated Docker container. -
โ๏ธ Dynamic Docker Provisioning
Automatically creates and starts a fresh Ubuntu-based Docker container for each new incoming connection. -
๐ป PTY Support
Uses creack/pty to provide fully interactive Bash shells with support for:- Shell prompts
- Line editing
- Signal handling (Ctrl+C, etc.)
-
๐ Bidirectional I/O Streaming
Bridges the TCP connection with the containerโs PTY master usingio.Copyfor low-latency, real-time interaction. -
โฑ Automatic Session Expiry
Usescontext.WithTimeoutto enforce time limits on sessions and automatically clean up containers after timeout.
- Listens on a TCP port for incoming client connections.
- Upon connection, spawns a new Docker container running an interactive Bash shell.
- Sets up a PTY inside the container and bridges it with the client over TCP.
- Automatically tears down the session and container after the allocated time.
- Language: Go
- Containerization: Docker
- Terminal Emulation: creack/pty
- Concurrency: Goroutines and context for timeouts
- Docker installed and running
- Go installed (
go 1.20+recommended)
go run main.go