Home Ask Login Register

Developers Planet

Your answer is one click away!

safazi February 2016

Websocket in limited Lua?

I'm looking to make a project involving websockets in pure lua, but the environment I have available is limited. There is no io or require. All I can do is HTTP get and post. Using only this, is it possible to make something like a websocket? I'm not very sure myself if it's possible.

Using PHP and HTTP get, I can read and write files.

edit: no external libraries or c libraries.


EinsteinK February 2016

Can you use external PHP libraries? PHP does have some websocket libraries: http://socketo.me/

It wouldn't be easy, but you could use HTTP GET/POST requests for this. The right request creates a socket, while other requests control it. Using a "websocket session" you can do it, but are you sure you need it? If you're limited to only regular HTTP GETs and POSTs, it won't help much.

Post Status

Asked in February 2016
Viewed 1,647 times
Voted 4
Answered 1 times


Leave an answer

Quote of the day: live life