←back to thread

245 points marcodiego | 3 comments | | HN request time: 0.718s | source
Show context
philipwhiuk ◴[] No.45799836[source]

   ~ # ping 8.8.8.8
   PING 8.8.8.8 (8.8.8.8): 56 data bytes
   ping: can't create raw socket: Function not implemented
   [Runner sh (18823808)]: Wasm crash: RuntimeError: memory access out of bounds
darn
replies(1): >>45800638 #
kro ◴[] No.45800638[source]
Afaik wasm cannot open network sockets.

The segfault is unfortunate though

replies(1): >>45801326 #
s-macke ◴[] No.45801326[source]
You can write a network device driver, which exports the network packages into JavaScript. The author already wrote a console device. So, not much of a deal.

https://github.com/joelseverin/linux-wasm/blob/master/patche...

replies(1): >>45801700 #
1. seanw265 ◴[] No.45801700[source]
Doable for http and https, but if you're running it in a browser environment, you'll eventually run into issues with CORS and other protocols. To get around this you need a proxy server running elsewhere that exposes the lower layers of the network stack.
replies(1): >>45801800 #
2. s-macke ◴[] No.45801800[source]
This is exactly what [0] does. Try it out. If you know the IP you can even log in to another open browser window via telnet.

[0] https://github.com/s-macke/jor1k

replies(1): >>45801999 #
3. seanw265 ◴[] No.45801999[source]
Aha! Now I see I'm talking to the expert on the topic ;) Thanks for the link. I'll check this out.