How to use it on wasm? #382
-
|
After checking the repository and PRs, I see that the library supports WASM. However, when I tried using it to create a very basic SSH client, I ran into issues during the compilation to WASM. The problem seems to stem from The error I encountered was something like this: I would really appreciate it if there were any examples or resources available related to using this library with WASM. For reference, I am using version 0.46 of |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 8 replies
-
|
@irvingoujAtDevolution You should also include a simple wasm example |
Beta Was this translation helpful? Give feedback.
-
|
You cannot use tokio, try wasm_bindgen_futures |
Beta Was this translation helpful? Give feedback.
-
|
Not really helpful, but: It just worked for me when I tried it. Sorry, I cannot share an example, but... where does your dependency on tokio come from? Are you perhaps enabling some tokio features that you must not enable? |
Beta Was this translation helpful? Give feedback.
-
|
I think I know your problem, did you use connect? not connect_stream? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I am trying to build it, this sample is working correctly but i need to use russh-keys and if i include it i get error: This wasm target is unsupported by mio. If using Tokio, disable the net feature. Can you please help what is needed here |
Beta Was this translation helpful? Give feedback.
-
|
I have one more question, when we use this as web assembly, how is internal threading works. Is there any set of rules we need to follow. |
Beta Was this translation helpful? Give feedback.
-
|
I am trying to use sftp with wasm, call to let sftp = SftpSession::new(sftp_channel.into_stream()).await.unwrap(); is causing panic, here is the stack at russh_client_core.wasm.tokio::task::spawn::spawn::h56104c0206615506 (russh_client_core_bg.wasm:0x1a28dd) What needs to be done here? |
Beta Was this translation helpful? Give feedback.
https://github.com/irvingoujAtDevolution/russh-wasm-example