Lua with the Freebase API

I need to use the Freebase API in the Lua, but Google requires that you use SSL.

Lua have no built-in network support, so I have to use external elements such as LuaSocket and 'LuaSec`. The problem is that I can not install them.

I use ZeroBrane IDE, so I tried to download and put them in a directory lualibs , following the instructions on the websites libs. But ssl.core and ssl.context absent.

Where can I find them ?!

+2
source share
1 answer

ssl.core and ssl.context appear within the SSL dynamic library. If you are on Windows, all you have to do is put ssl.dll in the folder <ZeroBraneStudio>\bin\clibs\ ( ssl.lua and ssl\https.lua already included in the installation folder ZBS lualibs ), and you should be able to run the following example (I just tested it):

 require("socket") local https = require("ssl.https") local body, code, headers, status = https.request("https://www.google.com") print(status) 

I posted a more complex example which shows the setting steps and handshakes here: http://notebook.kulchenko.com/programming/https-ssl-calls-with-lua-and-luasec .

+4
source

Source: https://habr.com/ru/post/1491798/