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

Error loading module (Lua)

I am having trouble with this error I am receiving whenever I run my application. The error is: loop or previous error loading module 'socket'. The code that is causing this error is: socket = require("socket"). This error occurs during the first…
koralarts
  • 2,062
  • 4
  • 30
  • 48
3
votes
1 answer

simulation login using lua

Our application need to use Lua to fetch some data from website.But the website require authentication(like google's login method). I'm trying to use the LuaSocket library, but I can't find a full example of code, so I'm only half-aware of what I…
ms2008
  • 362
  • 4
  • 19
2
votes
2 answers

LuaSocket socket/core.dll required location?

When I use local socket = require("socket.core") It works fine, the dll is located at "dir/socket/core.dll" but when I move the dll to say "dir/folder/core.dll" and use local socket = require("folder.core.") It returns that it was found however it…
Joe Johnson
  • 23
  • 1
  • 4
2
votes
0 answers

Workaround for an API not allowing require a specific library (luasocket) and not able to include it via moving DLL

I am using an API called Piepan, which allows me to write Lua scripts for Mumble bots. For context, it is written in Golang using an alternative mumble implementation called Gumble. Piepan scripts are executed via cmd prompt through a piepan.exe. I…
Allister
  • 903
  • 1
  • 5
  • 15
2
votes
0 answers

luasocket + copas error - attempt to yield across C-call boundary

I'm new to Lua and trying to implement TCP server and client in Openwrt using luasocket and copas. The goal is to make 3 program communicate with each other via socket in asynchronous networking. Below is the script local copas =…
mffathurr
  • 21
  • 1
2
votes
1 answer

How to send a POST request with OAUTH in Lua

So I want to tweet on Twitter by sending a POST request to the Twitter API. I have not found a simple way to do this (unless I use a wrapper), and I'm not too experienced with Lua. This is Twitter's own example using curl: $ curl --request POST…
Tearzz
  • 321
  • 1
  • 4
  • 14
2
votes
1 answer

How to check if a nonblocking luasocket client has lost it's connection?

I'm writing a Lua-script for OBS, that continually recieves data from ProPresenter(another program) over a TCP connection. I use the LuaSocket library to make the connection, and i get the data as expected. The problem is that when i close…
Aron
  • 23
  • 4
2
votes
1 answer

Difference between firefox and luasocket with same headers

I'm trying to get 'https://translate.google.com' via luasocket. Headers is based on HttpFox'es output; My attempt to get content: local r, c, h, fc = http.request { -- result (1 or nil on error), code (should be 200), headers, fancy code url =…
val - disappointed in SE
  • 1,475
  • 3
  • 16
  • 40
2
votes
1 answer

Downloading a file using luasocket

I'm sorry if this has a simple solution, or if this has been resolved before, but I am so far removed from any kind of network programming that I really have no idea what is even wrong nor what to search for to fix it. I would like to be able to…
Trey Reynolds
  • 693
  • 8
  • 11
2
votes
1 answer

"specified procedure could not be found" with Lua5.1 LuaSockets Win 64bit C++

I'm trying to make ZBS work in Windows, with both Lua 5.1 and luasockets compiled as 64bit C++ sources. I'm getting the following error: error loading module 'socket.core' from file 'socket\core.dll': The specified procedure could not be…
2
votes
1 answer

Capture full response in Lua Socket call

I am trying to call a REST API through LUA. However, I am not able to capture full raw response returned by the API. Below is the code sample: local http_socket = require("socket.http") local pretty_print = require("pl.pretty") local header = { …
Geek
  • 1,369
  • 1
  • 14
  • 25
2
votes
1 answer

Lua, how to read from unix file socket

i am realy struggling to connect and read from a existing unix file socket. the socket exist, is Mode +rwx and should return a json oneliner (without newline). (i have no Problem to read the socket on debian based systems like ncat -U…
2
votes
0 answers

Lua and Php file upload

I'm attempting to use Lua (Love2d to be exact) to download and upload files to and from my server. Downloading went quite smooth using luasocket's http.request, but I'm having a lot of trouble doing the same with uploading. I've put a index.html and…
2
votes
1 answer

How to issue commands in Luasocket FTP

Good afternoon, i'm currently writing on a Lua-script to upload a JCL to an IBM Mainframe (z/OS) via FTP. Before uploading my JCL, i first have to issue the command site filetype=jes to connect to JESPLEX. I'd greatly appreciate it if anyone could…
2
votes
2 answers

Lua - Socket receive with timer for other event

I am trying to implement a script with a server socket that will also periodically poll for data from several sensors (i.e on 59th second of every minute). I do not want to serialize the data to disk but rather keep it in a table which the socket…
Nepaluz
  • 669
  • 1
  • 12
  • 27