Can Duktape make HTTP requests

I have a very simple duktape plugin built into another program. Simple stuff works, but I'm not sure how to make HTTP requests. Is it even possible to make an HTTP request from a Duktape virtual machine?

+4
source share
4 answers

No, you can’t. The hosting application must provide it Duktape. Duktapeprovides JavaScript runtime, but does not provide a feature that you can also find in browsers using JavaScript.

+4
source

To make HTTP requests in your duktape program, you must bind your own function (in C, if your program is in C) that will make a request and return a response

+2

It would be nice to implement XMLHttpRequest in duktape. This will open the door to many useful use cases and bring them one step closer to using popular js libraries. Are there any plans for this?

+1
source

You can implement the socket interface in c and then register with duktape.

0
source

All Articles