Page 1 of 2
Using openssl with love
Posted: Fri Feb 12, 2016 1:32 am
by mmanso
Hi there
In a cross platform love game, is possible to use lua openssl module?
If yes, if there any guide about such a thing? There must be some point where any kind of compilation needs to be made for each target platform, correct?
Any docs about such a thing would be appreciated.
Thanks a lot.
Re: Using openssl with love
Posted: Fri Feb 12, 2016 1:39 am
by bobbyjones
You just need to distribute luasec and openssl binaries for all the platforms you need to support
Re: Using openssl with love
Posted: Fri Feb 12, 2016 5:06 am
by josefnpat
You will need to make binaries for each platform you want to deploy to, and require them in your code. I made an effort at one point here to bring the binaries togehter here:
viewtopic.php?f=5&p=158919
Honestly though, if you just need https (or a way to make a key) just use LPGhatguy's luajit request:
https://github.com/LPGhatguy/luajit-request
Re: Using openssl with love
Posted: Fri Feb 12, 2016 8:34 am
by mmanso
Hi there
I dont need https. I need to generate some signatures to integrate some data on a foreign system.
The idea behind these concepts is to compile love2d with ssl support or compile the lua library itself with the ssl support?
Thanks a lot.
Re: Using openssl with love
Posted: Fri Feb 12, 2016 2:21 pm
by bobbyjones
It's a library. Luasec is a C library for lua that provides HTTPS. I believe it also provides other parts of openssl but I'm not sure. There is also other libraries that provide features from openssl. You can most likely google "Lua lib for x" and it will most likely pop up with a library that can do what you want. Once you find a library and it is compiled for all the platforms you want to support you will need to load it via require and from there you use the library.
Re: Using openssl with love
Posted: Fri Feb 12, 2016 5:24 pm
by mmanso
Hi there,
Having the same library compiled several times (lets say lua-openssl) for different platforms how in my code will I be able to define I want to load this or that platform for lua-openssl?
Sorry for the question but I'm a newbie and since I'm loving love2d, I'm trying to kill all the requirements I have.
Thanks!
Re: Using openssl with love
Posted: Fri Feb 12, 2016 5:54 pm
by zorg
You can get the OS with [wiki]love.system.getOS[/wiki], and if this needs to detect 32 and 64bit as separate architectures as well, then luaJIT has a neat "jit.arch" field that can tell you that too (it does have its own jit.os field as well, if you prefer that over love's, though i don't know if that will work on mobile or not)
Re: Using openssl with love
Posted: Fri Feb 12, 2016 7:13 pm
by mmanso
I'm a newbie to all this... do you have a minute to explain me the differnece between lua and luajit? Love2d uses the lua engine, correct? this is something we can choose on? have a love2d that uses lua or luajit?
Sorry for the inconvenience but like I said, I just arrived to this new and beautifull world
Thanks.
Re: Using openssl with love
Posted: Fri Feb 12, 2016 8:25 pm
by zorg
Löve is the engine (or rather, the framework), it is coded in the lua and C++ programming languages, and since whatever version, it handles lua through luaJIT instead of plain lua.
You still code your games in the lua language, the only difference is that on some systems (win, osx, linux), code runs faster because of the above fact.
You can not (easily) opt-out of luaJIT, but you can disable the JIT part (the just in time compiler), but that will usually not have a good effect on your game (read: it will run slower).
Re: Using openssl with love
Posted: Fri Feb 12, 2016 8:40 pm
by Nixola
You can actually just swap the .dll/.so/whatever file with the Lua 5.1 one, if I recall correctly.