https://github.com/hlhr202/openconnect-rs
An Openconnect Lib/GUI for rust
https://github.com/hlhr202/openconnect-rs
anyconnect gui openconnect rust tauri vpn vpn-client
Last synced: about 1 year ago
JSON representation
An Openconnect Lib/GUI for rust
- Host: GitHub
- URL: https://github.com/hlhr202/openconnect-rs
- Owner: hlhr202
- License: lgpl-2.1
- Created: 2024-03-02T15:55:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-24T02:52:07.000Z (about 2 years ago)
- Last Synced: 2025-03-26T00:11:33.473Z (about 1 year ago)
- Topics: anyconnect, gui, openconnect, rust, tauri, vpn, vpn-client
- Language: Rust
- Homepage: https://crates.io/crates/openconnect-core
- Size: 3.96 MB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-LGPL
Awesome Lists containing this project
README
# OpenConnect for Rust

This is a cross-platform GUI client for OpenConnect, written in Rust and designed to work seamlessly on Windows, Linux, and macOS desktop systems. The program utilizes various technologies including MSYS2, Tauri, React, and NextUI. It provides a user-friendly interface for connecting to VPN servers using both password and OIDC authentication methods.
## Features
- Cross-platform compatibility (Windows, Linux, macOS)
- Easy-to-use GUI interface
- Support for both password and OIDC authentication
- Built with MSYS2, Tauri, React, and NextUI
## Screenshots

## Installation of Client
- GUI:
- Supports Windows(x64), Linux(x64), and macOS(aarch64, x64)
- Download can be found in [Releases](https://github.com/hlhr202/Openconnect-RS/releases)
- CLI install:
- Only supports Linux(x64) and macOS(aarch64, x64)
- Run the following command in your terminal:
```bash
curl -sL https://raw.githubusercontent.com/hlhr202/Openconnect-RS/main/install-cli.sh | bash
```
## Usage of CLI client
- Run the following command in your terminal:
```bash
openconnect --help
```
This will print the following help message:
```plaintext
A CLI client to connect to VPN using OpenConnect
Usage: openconnect
Commands:
start Connect to a VPN server and run in daemon mode [aliases: connect, run]
status Get the current VPN connection status [aliases: info, stat]
stop Close the current connection and exit the daemon process [aliases: kill, disconnect]
add Add new VPN server configuration to local config file [aliases: new, create, insert]
import Import VPN server configurations from a base64 encoded string
export Export VPN server configurations to a base64 encoded string
delete Delete a VPN server configuration from local config file [aliases: rm, remove, del]
list List all VPN server configurations in local config file [aliases: ls, l]
logs Show logs of the daemon process [aliases: log]
gen-complete Generate shell completion script
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
```
- For each subcommand, you can run `openconnect --help` to get more information
For example:
```bash
openconnect start --help
```
This will print the following help message:
```plaintext
Connect to a VPN server and run in daemon mode
Usage: openconnect start [OPTIONS]
Arguments:
The server name saved in local config file to connect to
Options:
-c, --config-file The path to the local config file
-h, --help Print help
```
### Generate shell completion script
- ZSH (Oh My Zsh!)
```bash
mkdir -p ~/.oh-my-zsh/custom/plugins/openconnect
openconnect gen-complete zsh > ~/.oh-my-zsh/custom/plugins/openconnect/openconnect.plugin.zsh
```
Then add `openconnect` to the `plugins` array in your `~/.zshrc` file:
- Bash
```bash
mkdir -p ~/.bash_completion
openconnect gen-complete bash > ~/.bash_completion/openconnect
echo "source ~/.bash_completion/openconnect" >> ~/.bashrc
```
## Build
- Read the [System Requirements](./crates/openconnect-sys/README.md) for environment setup
- Modify it to fit your environment (For automatic setup, its WIP)
- For windows, since openconnect provides GNU automake, we currently only support MSYS2-MINGW64 and `x86_64-pc-windows-gnu` toolchain
- Install MSYS2
- Install `x86_64-pc-windows-gnu` toolchain with command `rustup default stable-x86_64-pc-windows-gnu`
- Run cargo under MINGW64 shell
## License
Since Openconnect is released under LGPL license, the core libraries (openconnect-core and openconnect-sys) of this project is licensed under the GNU Lesser General Public License (LGPL). See the [LICENSE](./LICENSE-LGPL) file for details.
For some part of this library (openconnect-oidc), it is licensed under the MIT license.
## Acknowledgements
Special thanks to (MORE THAN) the following projects and technologies for making this project possible:
- [OpenConnect](https://www.infradead.org/openconnect/)
- [MSYS2](https://www.msys2.org/)
- [Tauri](https://tauri.app/)
- [Tokio](https://tokio.rs/)
- [Windows-rs](https://github.com/microsoft/windows-rs)
- [OpenIDConnect](https://github.com/ramosbugs/openidconnect-rs)
- [React](https://reactjs.org/)
- [NextUI](https://nextui.org/)
- [Vite](https://vitejs.dev/)
## Roadmap
### Openconnect sys
- [x] Automatically build openconnect
- [x] Automatically search library path
- [ ] Optimize search path for more cases
- [ ] better docs
### Openconnect core
- [x] implement safe ffi
- [x] implement username + password login
- [x] implement cookie login
- [x] implement ssl certificate validation
- [ ] implement public key login
- [ ] implement various auth methods
- [ ] better docs
### Client
- [x] implement username + password login
- [x] implement oidc login
- [x] implement logs
- [x] tracing file rotation
- [ ] optimize log search
- [x] implement CLI
- [x] Add/Remove configurations
- [x] Daemon mode
- [x] Password login
- [x] OIDC login