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
0
votes
1 answer

about the lua version installed on armbian , it seems confusing

The armbian img is "Armbian_23.05.0_amlogic_s905l3a_bullseye_5.15.110_server_2023.05.02" I want use luasocket, but it is not support lua 5.4, so lua 5.1 was installed, however...... Which lua version installed? i want lua 5.1 only, and what can i…
0
votes
0 answers

How to install LuaSocket version 3.0rc1-2 through luarocks?

I am attempting to create a website through Lua. In the process of installing the Orbit module, I installed the Luasocket module. It says that the 3.0rc12 module is not installed even though the lua socket module is already installed. How to solve…
0
votes
0 answers

What are my chances to get some basic web interaction from a program using Lua for scripts extensibility?

I'm very lost with this matter, so sorry if I'm asking for something too obvious or something, but I've been trying to get some low level info about it and, for what I've seen till now, I wouldn't even know where to start... Anyway, the case is I'm…
Rai
  • 314
  • 1
  • 2
  • 9
0
votes
1 answer

Luasockets get the lua files

can I get the the .lua files that comes with luasockets somewhere? Like ftp.lua , http.lua etc... I have no idea how to build something I trying a lot with VStudio but no luck. I tried to look how to build but I didnt understood, did I need lua?…
Cacilda
  • 17
  • 4
0
votes
0 answers

Lua - Handle a 301 Moved Permanently error and then save generated image from resulting URL

I’m trying to make a http.request to have a graph created, and then save the resulting .png graph image that is created. The problem is I want to do this with Lua, yet I’m struggling on two parts. (If you take url, you’ll see that this should work…
nodecentral
  • 446
  • 3
  • 16
0
votes
1 answer

LuaSockets POST data issue [LUA]

I'm getting GET data without issue using: local get, err = client:receive() But I'm not sure how to receive POST data. I've tried: local get, err = client:receive('*a') But the server seems to always timeout on POST data (the test…
Shane Gadsby
  • 1,260
  • 1
  • 13
  • 19
0
votes
1 answer

smtp.lua:80: attempt to call field 'b64' (a nil value) when trying to send an email using lua socket

So I tried sending an email using the luasocket smtp function with ssl but for some reason I get this error /usr/local/share/lua/5.1/socket/smtp.lua:80: attempt to call field 'b64' (a nil value) I have all the libraries downloaded and I don't know…
ElpersonPL
  • 17
  • 1
  • 4
0
votes
1 answer

how to send email using lua programming language?

Can someone please give detailed explanation on how to send an email using lua, and please share a template. Should the follow the same procedure to send mail using gmail account? I'm on windows 10 and using lua 5.1. Scenario: I have a lua function…
Ashay Fernandes
  • 353
  • 4
  • 14
0
votes
0 answers

Lua - Request works via curl, but not via Lua (Lua socket)?

I’m trying to interact with the Sipgate api (https://developer.sipgate.io/ ) using Lua, and an example they provide for authentication uses Curl, which works. (Not my b64 user/pass) curl \ --request GET \ --header "Accept: application/json" \ …
nodecentral
  • 446
  • 3
  • 16
0
votes
0 answers

How to read data from socket in Lua until no more data is available?

I can't manage to read the data from a luasocket. If i read more than the available data, the function call keeps blocked waiting until the client decides to close. https://github.com/StringManolo/LuaServer/blob/main/tmpServer.lua#L216 line,…
String Manolo
  • 35
  • 2
  • 8
0
votes
0 answers

Lua self method call attempt (a nil value)

I wrote a small class to receive data over TCP, but periodically (not constantly, sometimes the script runs long enough and receives data) I get an error: .\modules\tcp.lua:83: attempt to call method '_parsing' (a nil value) I can't figure out why…
Max Power
  • 83
  • 1
  • 6
0
votes
0 answers

How to send web requests using LuaSocket

How exactly do you use LuaSocket to send web requests?
0
votes
1 answer

Using Lua package (LuaSocket) with HAProxy

I have installed HAProxy with Lua 5.3.1, and also LuaSocket. I have LUA_PATH and LUA_CPATH defined: export LUA_PATH="/usr/local/share/lua/5.3/?.lua;?.lua" export LUA_CPATH="/usr/local/lib/lua/5.3/?.so;?.so" and I'm using LuaSocket in my .lua…
Jim W
  • 4,866
  • 1
  • 27
  • 43
0
votes
1 answer

How to make a makefile for lua 5.1.5 on windows or get LuaSocket for lua 5.3.5?

I'm attempting to make a simple server to client communication for fun using lua. The only library i've found able to do this is luasocket, but it's only for lua 5.1, and I cant seem to find any clear instruction as to how to build the makefile for…
Stratiz
  • 9
  • 3
0
votes
0 answers

UDP Hole punching guidance

I am trying to experiment with UDP hole punching to try to connect 2 computers. The 2 computers I am trying to connect are on 2 different Wifi created by the same router. Let me call these computers C1 and C2. So I want to create a connection…
Milind
  • 415
  • 8
  • 24