WASI icon indicating copy to clipboard operation
WASI copied to clipboard

libcurl for networking (not just HTTP) in WASI

Open alterstep opened this issue 6 years ago • 5 comments

curl is used everywhere, and supports many protocols: HTTP, HTTP/2, even HTTP/3 already but also LDAP, SMTP, SFTP, SMB... all the possible features and options of these protocols are available. curl has a generic, very stable interface for all these protocols. It can be blocking or non-blocking. Wrappers for many programming languages exist. curl developer works at Mozilla. WASI cannot do networking at the moment. Has curl integration in WASI been considered?

alterstep avatar Oct 05 '19 10:10 alterstep

From my perspective, talking about a possible WASI HTTP API proposal doesn't preclude talking about a possible WASI sockets API proposal too. It may even turn out to be possible to implement a WASI HTTP API as a wasm module on top of a WASI sockets API, perhaps even using curl compiled to wasm to do it. That's an appealing approach for engines that want to keep their surface area minimal. At the same time, some engines may want to implement HTTP natively. They may even be able to use curl in their implementation if they want to :-).

sunfishcode avatar Oct 05 '19 14:10 sunfishcode

libcurl compiled to wasm would be good! But every single application shouldn't have to bundle a copy of libcurl. It would be better if we can assume that the functions are always available, like WASI.

alterstep avatar Oct 08 '19 15:10 alterstep

libcurl compiled to wasm would be good! But every single application shouldn't have to bundle a copy of libcurl. It would be better if we can assume that the functions are always available, like WASI.

Hi, I would like to know how to compile libcurl to wasm library. Could I trouble you to give some tips? Thank you very much.

zlonqi avatar Jan 07 '22 07:01 zlonqi

At present, WASI has no networking APIs, so libcurl is unlikely to be compilable. Various groups are working on this, so it's possible there will be other answers in the future.

sunfishcode avatar Jan 19 '22 00:01 sunfishcode

To those who are interested; I've created a draft proposal at: https://github.com/badeend/WASI-Networking

badeend avatar Jan 25 '22 20:01 badeend