PDA

View Full Version : socket.http problem



esajesa
November 17th, 2013, 04:05 PM
Hi all,

feel like a newbie here but I will use five years of Girder absence as my excuse! ;)

I have a problem using socket.http, basically it seems like whatever I do I only get a NIL back.

In the simplest form I have a piece of code that looks like:

require ('socket.http')
local response = socket.http.request("http://www.google.com")
print(response)

And all I get is nil.

I've tried using a webserver on my local network, I've disabled my firewall etc. And I've tried with all different kinds of variations of the socket.http.request call, but all give me the same result.

Any ideas?

Cheers,
Jens

Ron
November 18th, 2013, 07:32 AM
Not sure. This page has some extra info:

http://w3.impa.br/~diego/software/luasocket/http.html

Try doing b,e = http.request ( ... )

Then print both b and e

e should contain an error description and help you along

esajesa
November 19th, 2013, 04:08 AM
Hi Ron,

no luck, it just says closed. But b is still nil.

I tried installing G5.1 as well, but the same result. And G6 doesn't seem to have luasocket additions yet?

//Jens

Ron
November 19th, 2013, 07:17 AM
Girder 6 has network.get to do this.

esajesa
November 20th, 2013, 03:23 PM
Cool!

Turned out it was something wrong with my computer, I installed a fresh W7 and it all works fine with http.request now.

Any chance to get Verse in G5/G6? Or any other XMPP library by all means.

What do I have to do for a G6 license Ron?? ;)

//Jens