This project on Go implements a web-based terminal for interacting with virtual machines (VMs) using WebSockets. It allows users to connect to and control two virtual machines in a session through a web interface.
- Web Terminal: Uses
xterm.jsfor terminal emulation in the browser. - Session Management: Supports creating, managing, and closing sessions.
- Machine Interaction: Users can connect to two virtual machines (VM1 and VM2) running on the server.
- WebSocket Communication: Provides real-time, bidirectional communication between the browser and the server, sending and receiving terminal data.
- Network Configuration: Dynamically creates and manages virtual network interfaces (TAP devices) for each session and VM.
- A session is created by calling the
/create_sessionendpoint, generating a unique session ID. - Users can connect to either VM1 or VM2 through WebSocket, with terminal data sent back and forth.
- The session is automatically cleaned up after inactivity or when the user navigates away from the page.