feat(wasm-support): add wasm support #351
Open
+1,137
−704
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
russh-util
crate, and sealed the runtime with conditional compilation: Tokio for non-WASM, and wasm-bindgen for WASM.russh-util
: using std::time for non-WASM, and chrono for WASM.cryptovec
, encapsulating the differences formemset
,memcpy
,mlock
, andmunlock
into separate files, gated behind feature flags.server
module from compiling for WASM. If anyone needs it in the future, they can follow a similar approach to the one I used.known_hosts
module and gated it behind a compilation flag, as the WASM environment typically lacks a file system.server
-specificcfg
andcfg_attr
attributes to handle platform differences in usage.Let me know if any further modifications are needed!