Questions tagged [luasocket]

LuaSocket is a Lua extension library that helps to add support for functionality commonly needed by applications that deal with the Internet. It provides easy access to TCP, UDP, DNS, SMTP, FTP, HTTP, MIME and more.

LuaSocket is a extension library that is composed by two parts: a C core that provides support for the TCP and UDP transport layers, and a set of Lua modules that add support for functionality commonly needed by applications that deal with the Internet.

Author: Diego Nehab

The core support has been implemented so that it is both efficient and simple to use. It is available to any Lua application once it has been properly initialized by the interpreter in use. The code has been tested and runs well on several Windows and Unix platforms.

Among the support modules, the most commonly used implement the SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading files) client protocols. These provide a very natural and generic interface to the functionality defined by each protocol. In addition, you will find that the MIME (common encodings), URL (anything you could possible want to do with one) and LTN12 (filters, sinks, sources and pumps) modules can be very handy.

Useful Links

178 questions
1
vote
1 answer

luasocket ERROR_NOT_ENOUGH_MEMORY declaration

In windows 7 with MinGW installed, I try to install luasocket on lua-5.3.4 environment with luarocks-2.4.3-win32 I give the shell command c:\>luarocks install c:\luasocket-master\luasocket-scm-0.rockspec OR c:\>luarocks install luasocket I always…
Pietro
  • 125
  • 8
1
vote
1 answer

JSON string fails to convert to correct Lua table

I'm performing a request to a foreign API using luasec, lua-socket and converting the data, a JSON string, to a lua table with cjson. I've read the docs of said modules and unfortunately none of it helped me with my problem. Can't link more than 2…
1
vote
2 answers

What does "unconnected:sendto() " return value mean?

The LuaSocket documentation says: unconnected:sendto(datagram, ip, port) If successful, the method returns 1. In case of error, the method returns nil followed by an error message. But I get a value of 4. What does return value of 4 means? My…
msc
  • 33,420
  • 29
  • 119
  • 214
1
vote
1 answer

How to install Lua libraries on separate folder

Hello i would like to change folder that luasocket is installing to how can i do that ? My plan is at the end i want to export my lua file as exe and use it to run my server. I want to put luasocket inside Project file so other windows computer wont…
Quiloos39
  • 57
  • 1
  • 4
1
vote
1 answer

NodeMCU - Lua - HTTP Post or luasocket - Need guidance

This is my first time here and thought of joining the forum because I am new to Lua programming and have almost given up on HTTP Post method. I am trying my hands on IOT using ESP8266 (running on NodeMCU) and using ESPlore to send the Lua program…
DroidGamer
  • 11
  • 1
  • 3
1
vote
1 answer

Compiling LuaSocket: Cannot open file: 'string.h'

The log: C:\WINDOWS\system32>luarocks install luasocket Installing https://luarocks.org/luasocket-3.0rc1-2.src.rock... Using https://luarocks.org/luasocket-3.0rc1-2.src.rock... switching to 'build' mode cl /nologo /MD /O2 -c -Fosrc/mime.obj…
Zapk
  • 77
  • 6
1
vote
0 answers

Shutdown Remote Windows Machine

I'm looking for a way to remotely shutdown a Windows 7 or 8 machine with Lua. I can successfully use Telnet via the terminal in OS X or cmd prompt in Windows so I know the telnet server on the remote machine is working, login credentials work, and…
ent.prog
  • 11
  • 1
1
vote
1 answer

Uploading an image using LuaSocket

I'm trying to upload an image using luaSocket. Here is my Lua code: function uploadFile(dir) local resp = {} local body,code,headers,status = http.request{ url = "my_url", method = "POST", headers = { …
bizzobaz
  • 95
  • 1
  • 8
1
vote
1 answer

How to do an operation, and if it doesn't complete in 6 seconds to stop it?

I am trying to receive information from a telnet connection in Lua using LuaSocket. I have all of that up and running except when I receive, if I receive anything less than the maximum number of bytes it takes 5 seconds. If I receive anything more…
1
vote
0 answers

lua socket communication from c# receiving nil

I'm trying to use lua script to extract some data from a program, and then send that data to a c# script which then processed it and returns some simple messages for the lua script to then pass along to the program. The lua script is as follows --…
1
vote
1 answer

Luasocket Telnet Check

I'd like to write a Lua script to run in the background of my server that checks a connection to a server and port every few minutes. Basically, the logic would go as such: local success = check_connection("avalon-rpg.com", 443) if not success then …
Jonathan Picazo
  • 975
  • 3
  • 13
  • 23
1
vote
2 answers

How can I use LuaSocket in iOS app?

I'm developing an iOS app can run Lua scripts, I can easily integrate the base lua support with CocoaPods, but how can I add LuaSocket library into it? LuaSocket contains some C and some Lua files, does anyone have ideas?Thank you!
Suge
  • 2,808
  • 3
  • 48
  • 79
1
vote
0 answers

Openresty and luasocket error

I am trying to load luasocket lib from openresty, however, I've got very strange error: 2015/01/25 13:06:38 [error] 10065#0: *5 lua entry thread aborted: runtime error: error loading module 'socket.core' from file…
Lobster
  • 635
  • 2
  • 12
  • 30
1
vote
1 answer

can not require socket.so in lua

I use Lua-5.1.3 and luasocket-2.0.2.It is all right when I make the socket.so. When I require socket.so,it failed and give me this error: ./socket.so:undefined symbol:luaopen_socket. Because of my pool knowledge, I don't know how to handle the…
shengyu
  • 11
  • 2
1
vote
1 answer

Node.js and LÖVE2D socket communication

I'm trying to make node.js server and LÖVE2D client to communicate via sockets. (Just a simple "hello world" test.) Both node.js and LÖVE2D are running on the same PC. I managed to send a message from LÖVE2D to node.js, but I can't read server's…
apk
  • 133
  • 1
  • 10