5 releases (3 stable)

new 1.2.0 May 6, 2025
1.1.0 May 4, 2025
1.0.0 May 3, 2025
0.1.1 Apr 30, 2025
0.1.0 Apr 30, 2025

#191 in GUI

Download history 433/week @ 2025-04-29

433 downloads per month

Custom license

69KB
1K SLoC

libgsh  Rust Crate Version Rust Crate Downloads

This is a SDK library for building server applications that interact seamlessly with the gsh client. It provides essential tools and abstractions to enable efficient communication between the server and the gsh graphical shell client application.

Features

  • Server-Client Communication: Simplifies the process of establishing and managing connections with the gsh client.
  • Data Serialization: Includes utilities for encoding and decoding data exchanged between the server and client.
  • Extensibility: Designed to be modular and extensible, allowing developers to build custom server-side functionality.

This library is an integral part of the gsh ecosystem, enabling developers to create robust and interactive server applications that leverage the graphical capabilities of the gsh client.

Build a Server

Do you want to build your own service with gsh? Choose between these out-of-the-box server implementations:

Server Description Technology
async An asynchronous server that handle communication concurrently. Tokio async runtime
simple A basic server that handle non-blocking communication Native multi-threading

Recommendation
The async server provides better performance and scalability for most applications.

View the examples directory for service implementations using the async and simple servers. There you can view how they interact with the gsh client. View the compatibility document for more information on supported versions.

Architecture

The libgsh library is designed to be modular and extensible, allowing developers to build custom server-side functionality. It provides a set of abstractions and utilities that simplify the process of establishing and managing connections with the gsh client.

Architecture Diagram
Overview diagram

sequenceDiagram
	participant Client as gsh client
	participant CGSH as client <br> gsh library
	participant SGSH as server <br> gsh library
	participant Server as libgsh service

	Client->>CGSH: Connect to server
	CGSH-->>SGSH: TLS + Handshake
	SGSH->>Server: Client Hello message
	SGSH-->>CGSH: Server Hello ACK message
	alt Server require Authentication
	rect rgb(190, 30, 50)
		CGSH<<->>Client: Enter credentials
		CGSH-->>SGSH: Send credentials
		SGSH<<->>Server: Verify credentials
		SGSH-->>CGSH: Authentication result
	end
	end
	CGSH->>Client: Server Hello ACK message
	par main event loop
    rect rgb(50, 60, 210)
		Client->>Server: User input
		Server->>Client: Visual/Media output
	end
	end

Detailed communication diagram

Prerequisites

Install the following dependencies before proceeding with setting up your development environment:

  • Install Rust
  • Install Visual Studio 2022 version 17
    • In the "Workloads" tab enable "Desktop development with C++"
    • Click Modify at the bottom right
  • Install protoc version 30.2 (shared dependency)
  • Install cmake version 3.31.7 (sdl2 dependency)

Dependencies

~16–27MB
~502K SLoC