| Crates.io | webtorrent-rs-wrapper |
| lib.rs | webtorrent-rs-wrapper |
| version | 0.1.19 |
| created_at | 2025-05-12 13:04:31.508487+00 |
| updated_at | 2025-05-12 17:01:36.651541+00 |
| description | Rust wrapper for WebTorrent JavaScript library |
| homepage | |
| repository | https://github.com/anchalshivank/webtorrent-rs-wrapper |
| max_upload_size | |
| id | 1670555 |
| size | 31,052 |
This project is a WebAssembly (WASM) wrapper for WebTorrent implemented in Rust. It allows you to create a browser-based file sharing application using WebTorrent functionality, with the core logic written in Rust.
rustup if you haven't already)wasm-pack installed (Install it via cargo install wasm-pack)Clone the repository to your local machine:
git clone https://github.com/anchalshivank/webtorrent-rs-wrapper.git
cd webtorrent-rs-wrapper
Install the necessary dependencies:
cargo install wasm-pack
Run the following commands to build the WebAssembly binary:
# Clean any previous builds
cargo clean
# Build the project for the WebAssembly target (web)
wasm-pack build --target web
To view the application, you need to serve the generated index.html in a local server. You can use Python's built-in HTTP server:
python3 -m http.server 8080
Once the server is running, open your browser and go to http://localhost:8080. The application will allow you to upload and share files, or download files from other peers.
If you have a build.sh script for automating the build process, make sure to grant it execute permissions by running:
chmod +x ./build.sh
You can then execute the script with the following:
./build.sh
This will run the necessary build steps for the project.
src/: Contains the Rust source code for the WebTorrent wrapperpkg/: Contains the generated WebAssembly packageindex.html: The HTML file for the browser-based file-sharing appwasm-pack, Rust, and Python.package.json), make sure the required files are present in the directory.Feel free to contribute by opening issues or pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.