Closed sdeleuze closed 11 months ago
Closing this has been implemented.
That's maybe not the right place to ask, but since I am not sure where I should raise this, is it possible to share if Node.js is able to preopen a Socket and how this should be declared in JavaScript?
@sdeleuze while we've added the sock_ methods to uvwasi, their use has not yet been integrated into Node.js itself. That is somethig I've had on my TODO wish list but have not yet gotten to it.
I would be super interested in being able to have socket support in order to be able to implement network applications, such as a pure WASI HTTP server in https://github.com/sdeleuze/kowasm which leverages Node WASI API. I am not a C developer so I create this issue is case somebody would be interested to help on this, since there are a lot of use cases that require it. The support would be initially single-threaded but https://github.com/WebAssembly/wasi-threads is moving again so there is hope that limitation could be removed later.
This can be done by supporting
sock_accept()
which has been added pretty late to the spec. I previously leveraged that in a Rust + Mio HTTP server prototype which was running on Wasmtime. That would allow to anticipate WASI preview2 support which will provide more first class and standardized networking support.