This repository integrates a C-based WebSocket implementation into a Rust project using FFI. The core WebSocket logic is implemented entirely in C and included as a Git submodule. Rust bindings are generated from the C headers using bindgen.
This project uses a Git submodule:
Websocket: A C-based WebSocket implementation with a C API.
- Integrates a C WebSocket library directly into Rust.
- Uses
bindgento generate Rust FFI bindings from C headers. - Builds a shared Rust library using the C backend.
git clone --recurse-submodules https://github.com/Mylifeismyhome/Websocket-Rust.git
cd Websocket-RustYou will need the following installed:
- Rust and Cargo
- LLVM + Clang (required for
bindgen)
sudo apt update
sudo apt install llvm clang build-essential gitbrew install llvmMake sure LLVM is in your PATH:
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"Install LLVM via releases.llvm.org or:
choco install llvmInstall Rust via rustup.rs
Ensure cargo and clang are in your system PATH.
build.batchmod +x build.sh
./build.sh- If
bindgenfails, make sure LLVM and Clang are correctly installed and accessible via PATH. - On Windows, use the MSVC toolchain and developer command prompt if needed.
This project is licensed under the MIT License. See the LICENSE file for more info.