Open FreshXOpenSource opened 8 years ago
Http is easy enough given tls. We'll need openssl bindings or something to get tls though.
Libcurl is an option, but it's tricky to ensure it's non-blocking.
I'm starting on mbedtls bindings for duktape. Initially I'm just choosing the stuff I need for my personal project, but eventually we can add TLS support.
thats excellent!
do you plan to implement tls basic network functions in the near future?
not near future, sorry. Life got in the way again.
i wrote a simple request module using the example code given in the test-apps which runs basically fine using request(url,options,callback) unless we have more than one datagram. in this case the simple client example i wrote (attached) fails like this :
Requesting http://lorempixel.com/800/600/people/
Proto: http:// Host : lorempixel.com Port : 80 Path : /800/600/people/
Element Connection already in headers
DNS lookup of lorempixel.com resolves to 2a01:488:67:1000:253d:c8bc:0:1
Connected to 2a01:488:67:1000:253d:c8bc:0:1:80
ctx: top=1, stack=[{}]
Uncaught TypeError: not buffer
at [anon] (duk_bi_buffer.c:173) internal
at concat () native strict preventsyield
at concat (deps/http-codec:304) strict
at onRead (deps/wrap-socket:50) strict preventsyield
at [anon] () native strict preventsyield
at global (client.js:28) preventsyield
at [anon] () native strict preventsyield
at eval (eval:1) preventsyield```
The type of object which it tries to concat is sometimes buffer and sometimes object. Any ideas why the types dont match?
One big feature yet missing from the legacy duv implementation is the ability to make http(s) client requests. im not sure how nasty the original implementation was and if its better to avoid it but the feature is hardly missing