https requests from within a wasm compiled code

68 views
Skip to first unread message

Ronny Nissengold

unread,
Jul 30, 2023, 5:11:53 AM7/30/23
to emscripten-discuss
Hi all,
We are using a third party library to authenticate users to use our code.
The question is, when porting to WASM, will it be possible to use the third party as is? Is there any limitation to send and get a HTTPS request and response from WASM, or is it impossible due to the sandbox nature of EMSCRIPTEN?
Thanks!
Ronny.

Sam Clegg

unread,
Jul 30, 2023, 4:02:35 PM7/30/23
to emscripte...@googlegroups.com
This is possible with emscipten by calling out to JS to do that actual network requests.   Emscriptan has a couple of different builtin APIs for this (see fetch.h and wget.h which are documented https://emscripten.org/docs/api_reference/fetch.html and https://emscripten.org/docs/api_reference/emscripten.h.html#id4), or you can write you own use a JS library file or and EM_JS function.

cheers,
sam

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/d44a5988-4deb-44a6-a323-384a23ef748an%40googlegroups.com.

Ronny Nissengold

unread,
Aug 2, 2023, 7:06:57 AM8/2/23
to emscripten-discuss
Thanks!

ב-יום ראשון, 30 ביולי 2023 בשעה 23:02:35 UTC+3, s...@google.com כתב/ה:
Reply all
Reply to author
Forward
0 new messages