Make a https request

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
ananasblau
Prole
Posts: 11
Joined: Tue Nov 06, 2012 6:44 pm
Location: Austria
Contact:

Make a https request

Post by ananasblau »

Hi,
For an web API I'd like to communicate with I have to use https / ssl. I figured out how to make a normal http request.
But a https would require luasec which I'm not sure of how I can get that into my game's distribution.

So my question:

* How to make a https reuqest with löve OR
* How to distribute an additional library like luasec with my game.
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Make a https request

Post by substitute541 »

I'm... not sure if Love2D supports internet communication. It's a game engine anyways.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Make a https request

Post by Ensayia »

LOVE comes with Luasocket included, check the wiki on how to use it. I would also recommend checking out the LUBE library for ease of use.

Luasocket supports http requests, but not https. There is no built in https support in LOVE sadly.

EDIT: I'm tired and should have read your post more closely. You already know all of this :D
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: Make a https request

Post by miko »

ananasblau wrote:So my question:
* How to make a https reuqest with löve OR
As usual with luasec
ananasblau wrote: * How to distribute an additional library like luasec with my game.
You would need to distribute *.zip file containing:
- your *.love game
- dynamically loaded libraries for each supported architecture, so ssl.dll for windows, ssl.so for linux, and ssl."I_dont_know_what" for OSX.
Then instruct your users to put those library files in such location, where they could be found by love's dynamic loader (so maybe current directory, or within LD_LIBRARY_PATH etc).
Those library files should be compiled with the same compiler and libraries as the original love binary, so in practice this is really hard to do (unless you make it only for yourself or your friends)

Another (better) way would be to include luasec as a library compiled into love binary, as is luasocket. But you would need to make patches to love sources, compile it for every supported platform and distribute it in place of original love.

Another solution (even better) would be to implement SSL in plain lua, but that would be a huge task.

Personally, I would use LUBE or luasocket with UDP packets, as UDP packets are non-blocking.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
ananasblau
Prole
Posts: 11
Joined: Tue Nov 06, 2012 6:44 pm
Location: Austria
Contact:

Re: Make a https request

Post by ananasblau »

Thanks miko, compiling love was what i feared and I'm not keen on doing it as i haven't even got a windows machine to test. I guess I'll use a proxy to channel the game's http request to the https server.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests