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

Stop using cURL for backend #12

Open
LPGhatguy opened this issue Aug 19, 2017 · 4 comments
Open

Stop using cURL for backend #12

LPGhatguy opened this issue Aug 19, 2017 · 4 comments
Milestone

Comments

@LPGhatguy
Copy link
Owner

The libcurl API is not very nice to bind to, I should rewrite the library targeting a new HTTP backend if I can.

@LPGhatguy LPGhatguy added this to the 3.0.0 milestone Aug 19, 2017
@MikuAuahDark
Copy link

Maybe you can get inspiration from this? https://bitbucket.org/bartbes/lua-https

It uses Schannel in Windows and NSURL for macOS and iOS. Unfortunately, I don't think it's possible to interact with Objective-C code and for Linux you still have to rely on cURL.

@LPGhatguy
Copy link
Owner Author

I also took a try at making an async HTTP library for Lua awhile ago: https://github.com/LPGhatguy/lua-async-http

@MikuAuahDark
Copy link

I mentioned that specifically because lua-https, indeed supports https. If your async HTTP library can't do HTTPS then it's a downgrade of luajit-request, which, I'm sure the reason why people use this library in the first place.

As per async, you can always use timeout of 0 seconds on recv/select so you know exactly when to yield. I use this approach with LuaSocket in a dedicated game server, since the server runs single threaded, and I can't use Lanes due to thread safety issue, I used timeout of 0 and check if I really return value.

@LPGhatguy
Copy link
Owner Author

The library I linked does do HTTPS, using platform APIs. No HTTP library is very useful without HTTPS support in 2020. 😅

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

No branches or pull requests

2 participants