Lua - Https/ssl support?

I need to call to a web server from my game to log in, and transfer data. That web server is hosted on AWS. Standard Lua does not come with a built in mechanism for doing asynchronous web requests with SSL. The game engine needs to expose a way to make web-requests. I can’t find any documentation or suggestions that indicate that this exists in Lumberyard.

I am currently doing this in the C++ layer in Lumberyard 1.0 thru 1.3, but my code was broken with LY updates, and I keep having to re-write it. I would be much happier to do this in Lua.

Other game engines expose a custom Lua implementation of HTTP[S], which works like this:

[Defold]: http.request(fullUrl, “POST”, asyncCallback, requestHeaders, requestJsonBody, options)

[Corona]: network.request(fullUrl, “POST”, asyncCallback, { headers = requestHeaders, body = requestJson})

Anything close to this would be fantastic. I’d just ditch my C++ version and start over in Lua, and be completely happy about it.

If this already exists, please point me at it. If it does not, then I’d like to feature-request it.


Hello @PGilmore,

Thank you for your feedback! I agree, there definitely should be a way to execute HTTP and HTTPS requests from Lua. I’ve added it as a feature request and will have our internal team take a look at it!

In the meantime, it should be possible to expose that functionality from C++ to Lua by using the AZ_SCRIPTABLE_EBUS. If you are interested in knowing how, please take a look at UiCanvasLuaBus.cpp for an example.

Thank you!

Hello @PGilmore,

I have checked the issue for you and unfortunately it hasn’t been scheduled for a specific release yet. It is still undergoing investigation.

Thank you.

Any updates about this? I do not see it in the 1.5 patchnotes. Any hope for 1.6?

there is this:

you can create a C++ interface for lua using that.

Yes and no. Part of my point is that I don’t want to be the one supporting the C++ HTTPS in Lumberyard, because I’ve been trying to do that, and it’s not working out for me.

I’d like Lumberyard to be on-par with other engines and provide this support by default.

ah, i see.
were you using an http/ssl c++ library and binding those commands using something similar to the doc above?

Hello @PGilmore,

In 1.7, you can now use the HttpClient in Lua. Here’s the doucmentation on the Lua API:

One thing to keep in mind is since the HttpClientComponent is located in the CloudGemFramework gem, you will need to enable it to be able to use.

Based on the 1.7 patch notes, we seem to be moving in the wrong direction:

                "Native C++ libraries that are

not included in the distribution are still accessible through other Cloud Canvas
services, such as the HTTP client."