browser display error on tcp programming in yew #3368
-
Problem use std::io::{prelude::*, BufReader, Write}; pub fn socket_client(s: &str) -> String {
} ** error ** Stack: Error Expected behavior Screenshots Environment:
Questionnaire how to solve it , if use tcp socket programming in yew ? thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The Yew crew could chime in with a more specific answer, but because the WASM binary runs within the browser's sandbox and DOM, it can't interact with the kernel to open up arbitrary TCP sockets. However, you could do something like WebSocket or any of the other Fetch APIs exposed to regular web applications. |
Beta Was this translation helpful? Give feedback.
The Yew crew could chime in with a more specific answer, but because the WASM binary runs within the browser's sandbox and DOM, it can't interact with the kernel to open up arbitrary TCP sockets. However, you could do something like WebSocket or any of the other Fetch APIs exposed to regular web applications.