Hacker News new | ask | show | jobs
by xg15 16 hours ago
My understanding was that WASM itself has no access to browser APIs, meaning it can't do network requests on its own, not even at the level permitted by the browser sandbox. You have to have supporting JavaScript to do the requests on the WASM app's behalf, which gives you the same security environment as untrusted ad code (sadly).

So it's up to the JavaScript code launching the WASM how much the WASM can do.

I think I read somewhere else here that this project doesn't expose this ability to the "pods", but instead tunnels any network requests from the emulated Linux side back to the server?

Not sure if this is correct, but it would be necessary anyway if you wanted to enable intra-cluster communication like in a real Kubernetes cluster. E.g. the code inside a pod might do something like "curl http://some-other-service.main" . In a real cluster, this would be routed to another pod where an instance of the other service is running. In this browser version, some JavaScript would have to tunnel the request through the websocket connection somehow.

1 comments

You're correct, things like networking or file io that require syscalls need WASI, along with host code that implements WASI + exposes it to the guest

https://wasi.dev/