Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wasm-support): add wasm support (#351)
Hi @Eugeny, As mentioned in the previous pull request, it seems like you would prefer a complete PR for the entire integration. Hence, I have merged the previous two pull requests into one, containing the full integration. Please take a look! ### Key Changes: 1. Introduced the `russh-util` crate, and sealed the runtime with conditional compilation: **Tokio** for non-WASM, and **wasm-bindgen** for WASM. 2. Sealed the time functionality in `russh-util`: using **std::time** for non-WASM, and **chrono** for WASM. 3. Updated `cryptovec`, encapsulating the differences for `memset`, `memcpy`, `mlock`, and `munlock` into separate files, gated behind feature flags. 4. Conditionally excluded the `server` module from compiling for WASM. If anyone needs it in the future, they can follow a similar approach to the one I used. 5. Restructured the `known_hosts` module and gated it behind a compilation flag, as the WASM environment typically lacks a file system. 6. Made various minor changes to the project structure to improve maintainability. 7. Added `server`-specific `cfg` and `cfg_attr` attributes to handle platform differences in usage. Let me know if any further modifications are needed! --------- Co-authored-by: Eugene <[email protected]>
- Loading branch information