Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sock_accept() support #183

Closed
sdeleuze opened this issue Jan 15, 2023 · 4 comments
Closed

Add sock_accept() support #183

sdeleuze opened this issue Jan 15, 2023 · 4 comments

Comments

@sdeleuze
Copy link

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.

mhdawson added a commit to mhdawson/uvwasi that referenced this issue Jan 30, 2023
Refs: nodejs#183

add the stub for sock_accept so that we have
stubs for all method in the current version of
snapshot 1. sock_accept was added later after
snapshot 1 was first documented.

Does not complete nodejs#183 but is first step.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
mhdawson added a commit to mhdawson/uvwasi that referenced this issue Feb 22, 2023
Refs: nodejs#183

add the stub for sock_accept so that we have
stubs for all method in the current version of
snapshot 1. sock_accept was added later after
snapshot 1 was first documented.

Does not complete nodejs#183 but is first step.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
mhdawson added a commit that referenced this issue Feb 22, 2023
* add sub for sock_accept

Refs: #183

add the stub for sock_accept so that we have
stubs for all method in the current version of
snapshot 1. sock_accept was added later after
snapshot 1 was first documented.

Does not complete #183 but is first step.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
@mhdawson
Copy link
Member

mhdawson commented Mar 2, 2023

Related - #187

@mhdawson
Copy link
Member

Closing this has been implemented.

@sdeleuze
Copy link
Author

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?

@mhdawson
Copy link
Member

mhdawson commented Jan 2, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants