guac-bridge 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- guac_bridge-0.2.0/LICENSE +21 -0
- guac_bridge-0.2.0/PKG-INFO +122 -0
- guac_bridge-0.2.0/README.md +109 -0
- guac_bridge-0.2.0/pyproject.toml +27 -0
- guac_bridge-0.2.0/setup.cfg +4 -0
- guac_bridge-0.2.0/src/guac_bridge/__init__.py +2 -0
- guac_bridge-0.2.0/src/guac_bridge/client.py +561 -0
- guac_bridge-0.2.0/src/guac_bridge/server.py +160 -0
- guac_bridge-0.2.0/src/guac_bridge/ssh_client.py +216 -0
- guac_bridge-0.2.0/src/guac_bridge/ssh_server.py +187 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/PKG-INFO +122 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/SOURCES.txt +16 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/dependency_links.txt +1 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/entry_points.txt +5 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/requires.txt +1 -0
- guac_bridge-0.2.0/src/guac_bridge.egg-info/top_level.txt +1 -0
- guac_bridge-0.2.0/tests/test_bridge.py +342 -0
- guac_bridge-0.2.0/tests/test_ssh_bridge.py +351 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: guac-bridge
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Bridge remote LLM APIs and SSH over an Apache Guacamole terminal
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Repository, https://github.com/himbeles/guac-bridge
|
|
7
|
+
Project-URL: Issues, https://github.com/himbeles/guac-bridge/issues
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: aiohttp<4,>=3.10
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# Guac Bridge
|
|
15
|
+
|
|
16
|
+
Access an OpenAI-compatible endpoint or SSH service on a server through its
|
|
17
|
+
Guacamole web terminal.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
Install on both your client computer and the server. Requires Python 3.11+ and
|
|
22
|
+
[uv](https://docs.astral.sh/uv/).
|
|
23
|
+
|
|
24
|
+
```shell
|
|
25
|
+
uv tool install guac-bridge
|
|
26
|
+
uv tool update-shell
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The client starts the appropriate server helper automatically. Keep the client
|
|
30
|
+
running while using the bridge; stop it with **Ctrl+C**.
|
|
31
|
+
|
|
32
|
+
For the commands below, copy the full URL from your browser after opening the
|
|
33
|
+
desired Guacamole connection. Replace `CLIENT_ID` and `YOUR_USERNAME` with
|
|
34
|
+
your connection details. Your Guacamole password is prompted.
|
|
35
|
+
|
|
36
|
+
## Usage: LLM bridge
|
|
37
|
+
|
|
38
|
+
The server's OpenAI-compatible endpoint should be available at
|
|
39
|
+
`http://127.0.0.1:8000`.
|
|
40
|
+
|
|
41
|
+
On your client computer:
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
guac-llm-client --url "https://guacamole.example.com/#/client/CLIENT_ID" --username YOUR_USERNAME
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Configure your LLM application with:
|
|
48
|
+
|
|
49
|
+
| Setting | Value |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| OpenAI base URL | `http://127.0.0.1:8000/v1` |
|
|
52
|
+
| Chat completions URL | `http://127.0.0.1:8000/v1/chat/completions` |
|
|
53
|
+
| Model | A model ID from `/v1/models` |
|
|
54
|
+
| API key | The key required by the server endpoint, or a placeholder if none is required |
|
|
55
|
+
|
|
56
|
+
Requests, streamed responses, and the application's API key are forwarded to
|
|
57
|
+
the server endpoint.
|
|
58
|
+
|
|
59
|
+
Use `--upstream http://127.0.0.1:9000` for a different server-side endpoint
|
|
60
|
+
(omit `/v1`), or `--port 18000` for a different local port.
|
|
61
|
+
|
|
62
|
+
## Usage: SSH bridge
|
|
63
|
+
|
|
64
|
+
The server's SSH service should be reachable at `127.0.0.1:22`.
|
|
65
|
+
|
|
66
|
+
On your client computer:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
guac-ssh-client --url "https://guacamole.example.com/#/client/CLIENT_ID" --username YOUR_USERNAME
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In another local terminal:
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
ssh -p 2222 serveruser@127.0.0.1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use the server's SSH username and its usual password or SSH key. SSH
|
|
79
|
+
authentication and host-key verification are handled by your SSH client.
|
|
80
|
+
SCP and SFTP work through the same local port.
|
|
81
|
+
|
|
82
|
+
To forward the server's OpenAI-compatible endpoint through SSH:
|
|
83
|
+
|
|
84
|
+
```shell
|
|
85
|
+
ssh -p 2222 -N -L 8000:127.0.0.1:8000 serveruser@127.0.0.1
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Use `--target-port` to select a different server-side SSH port and `--port`
|
|
89
|
+
to change the local listener.
|
|
90
|
+
|
|
91
|
+
Both bridges support `--ca-file company-ca.pem` for a custom certificate
|
|
92
|
+
authority and `--transport http` to use Guacamole's HTTP tunnel.
|
|
93
|
+
If a helper is installed outside `~/.local/bin/`, pass its full path with
|
|
94
|
+
`--server-command`. Run either client with `--help` for all options.
|
|
95
|
+
|
|
96
|
+
## Contribution
|
|
97
|
+
|
|
98
|
+
Submit issues and pull requests on
|
|
99
|
+
[GitHub](https://github.com/himbeles/guac-bridge).
|
|
100
|
+
Include tests for behavior changes.
|
|
101
|
+
|
|
102
|
+
From a repository checkout, run the test suite in an environment with Bash and
|
|
103
|
+
PTY support:
|
|
104
|
+
|
|
105
|
+
```shell
|
|
106
|
+
uv run python -m unittest discover -s tests -v
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Architecture
|
|
110
|
+
|
|
111
|
+
Each client logs into Guacamole and starts its matching server helper inside
|
|
112
|
+
the terminal session. Framed, Base64-encoded messages travel through Guacamole's
|
|
113
|
+
input and output pipes.
|
|
114
|
+
|
|
115
|
+
| Bridge | Local listener | Server helper |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| LLM | OpenAI-compatible HTTP API | Forwards requests and streamed responses to the server endpoint |
|
|
118
|
+
| SSH | TCP port for your SSH client | Relays bytes to the server's SSH service |
|
|
119
|
+
|
|
120
|
+
Listeners bind to local loopback. Helpers connect to services on the server's
|
|
121
|
+
loopback interface, so no additional inbound server port is needed. Per-connection
|
|
122
|
+
flow control bounds buffering; disconnecting Guacamole closes active connections.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Guac Bridge
|
|
2
|
+
|
|
3
|
+
Access an OpenAI-compatible endpoint or SSH service on a server through its
|
|
4
|
+
Guacamole web terminal.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
Install on both your client computer and the server. Requires Python 3.11+ and
|
|
9
|
+
[uv](https://docs.astral.sh/uv/).
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
uv tool install guac-bridge
|
|
13
|
+
uv tool update-shell
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The client starts the appropriate server helper automatically. Keep the client
|
|
17
|
+
running while using the bridge; stop it with **Ctrl+C**.
|
|
18
|
+
|
|
19
|
+
For the commands below, copy the full URL from your browser after opening the
|
|
20
|
+
desired Guacamole connection. Replace `CLIENT_ID` and `YOUR_USERNAME` with
|
|
21
|
+
your connection details. Your Guacamole password is prompted.
|
|
22
|
+
|
|
23
|
+
## Usage: LLM bridge
|
|
24
|
+
|
|
25
|
+
The server's OpenAI-compatible endpoint should be available at
|
|
26
|
+
`http://127.0.0.1:8000`.
|
|
27
|
+
|
|
28
|
+
On your client computer:
|
|
29
|
+
|
|
30
|
+
```shell
|
|
31
|
+
guac-llm-client --url "https://guacamole.example.com/#/client/CLIENT_ID" --username YOUR_USERNAME
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Configure your LLM application with:
|
|
35
|
+
|
|
36
|
+
| Setting | Value |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| OpenAI base URL | `http://127.0.0.1:8000/v1` |
|
|
39
|
+
| Chat completions URL | `http://127.0.0.1:8000/v1/chat/completions` |
|
|
40
|
+
| Model | A model ID from `/v1/models` |
|
|
41
|
+
| API key | The key required by the server endpoint, or a placeholder if none is required |
|
|
42
|
+
|
|
43
|
+
Requests, streamed responses, and the application's API key are forwarded to
|
|
44
|
+
the server endpoint.
|
|
45
|
+
|
|
46
|
+
Use `--upstream http://127.0.0.1:9000` for a different server-side endpoint
|
|
47
|
+
(omit `/v1`), or `--port 18000` for a different local port.
|
|
48
|
+
|
|
49
|
+
## Usage: SSH bridge
|
|
50
|
+
|
|
51
|
+
The server's SSH service should be reachable at `127.0.0.1:22`.
|
|
52
|
+
|
|
53
|
+
On your client computer:
|
|
54
|
+
|
|
55
|
+
```shell
|
|
56
|
+
guac-ssh-client --url "https://guacamole.example.com/#/client/CLIENT_ID" --username YOUR_USERNAME
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
In another local terminal:
|
|
60
|
+
|
|
61
|
+
```shell
|
|
62
|
+
ssh -p 2222 serveruser@127.0.0.1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use the server's SSH username and its usual password or SSH key. SSH
|
|
66
|
+
authentication and host-key verification are handled by your SSH client.
|
|
67
|
+
SCP and SFTP work through the same local port.
|
|
68
|
+
|
|
69
|
+
To forward the server's OpenAI-compatible endpoint through SSH:
|
|
70
|
+
|
|
71
|
+
```shell
|
|
72
|
+
ssh -p 2222 -N -L 8000:127.0.0.1:8000 serveruser@127.0.0.1
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Use `--target-port` to select a different server-side SSH port and `--port`
|
|
76
|
+
to change the local listener.
|
|
77
|
+
|
|
78
|
+
Both bridges support `--ca-file company-ca.pem` for a custom certificate
|
|
79
|
+
authority and `--transport http` to use Guacamole's HTTP tunnel.
|
|
80
|
+
If a helper is installed outside `~/.local/bin/`, pass its full path with
|
|
81
|
+
`--server-command`. Run either client with `--help` for all options.
|
|
82
|
+
|
|
83
|
+
## Contribution
|
|
84
|
+
|
|
85
|
+
Submit issues and pull requests on
|
|
86
|
+
[GitHub](https://github.com/himbeles/guac-bridge).
|
|
87
|
+
Include tests for behavior changes.
|
|
88
|
+
|
|
89
|
+
From a repository checkout, run the test suite in an environment with Bash and
|
|
90
|
+
PTY support:
|
|
91
|
+
|
|
92
|
+
```shell
|
|
93
|
+
uv run python -m unittest discover -s tests -v
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Architecture
|
|
97
|
+
|
|
98
|
+
Each client logs into Guacamole and starts its matching server helper inside
|
|
99
|
+
the terminal session. Framed, Base64-encoded messages travel through Guacamole's
|
|
100
|
+
input and output pipes.
|
|
101
|
+
|
|
102
|
+
| Bridge | Local listener | Server helper |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| LLM | OpenAI-compatible HTTP API | Forwards requests and streamed responses to the server endpoint |
|
|
105
|
+
| SSH | TCP port for your SSH client | Relays bytes to the server's SSH service |
|
|
106
|
+
|
|
107
|
+
Listeners bind to local loopback. Helpers connect to services on the server's
|
|
108
|
+
loopback interface, so no additional inbound server port is needed. Per-connection
|
|
109
|
+
flow control bounds buffering; disconnecting Guacamole closes active connections.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "guac-bridge"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Bridge remote LLM APIs and SSH over an Apache Guacamole terminal"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = ["aiohttp>=3.10,<4"]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
|
|
15
|
+
[project.urls]
|
|
16
|
+
Repository = "https://github.com/himbeles/guac-bridge"
|
|
17
|
+
Issues = "https://github.com/himbeles/guac-bridge/issues"
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
guac-llm-client = "guac_bridge.client:cli"
|
|
21
|
+
guac-llm-server = "guac_bridge.server:cli"
|
|
22
|
+
guac-ssh-client = "guac_bridge.ssh_client:cli"
|
|
23
|
+
guac-ssh-server = "guac_bridge.ssh_server:cli"
|
|
24
|
+
|
|
25
|
+
[tool.setuptools.packages.find]
|
|
26
|
+
where = ["src"]
|
|
27
|
+
|