Skip to content

XxRoloxX/xterm-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xterm-server

This is a simple xterm server implementation that can be used to run xterm remotely in a browser. To connect to the server use the xterm.js library or any other reasonable websocket client.

Setup

Running the server

Run the following commands to setup the server:

git clone
cd xterm-server
docker compose up

Setting the xterm server port

You can set the port that the server listens on by setting the XTERM_PORT environment variable. The default port is 8080.

docker compose up -e XTERM_PORT=3000

Usage

With xterm.js

You can connect to the server using the xterm.js library. Here is an example of how you can do this within a browser:

import { Terminal } from "xterm";
const ws = new WebSocket("ws://localhost:3000");

const term = new Terminal();
term.open(document.getElementById("terminal"));

term.onData((data) => {
  ws.send(data);
});

ws.onmessage = (event) => {
  term.write(event.data);
};

Without browser

For more minimal usage, you can use tools such as websockat or wscat:

websockat ws://localhost:8080

Showcase

xterm-server

About

Lightweight xterm server written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published