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
0 answers

LuaSockets library will not correctly load

So, I've been annoyingly trying to work with LuaSockets2.0.2, and when I try to use it, I get the following error: lua5.1: /media/pi/Cruzer/Lua/flywheels.lua:7: module 'luasocket.c' not found: no field package.preload['luasocket.c'] no file…
0
votes
1 answer

How to install 32 bit luasocket on OSX or with 32 bit core.so

I can successfully install luasocket (https://github.com/diegonehab/luasocket) via luarocks, but I am having an issue with it working within a certain environment (https://dev.etlegacy.com/boards/2/topics/3388?r=3401). As far as I can tell, there's…
0
votes
0 answers

How can I distribute my program if it has dependencies?

So I recently wrote a chat bot which relies on lua and luasocket to respond to a twitch stream's chat. It's very basic and has various files it reads/writes to. It runs from the local computer. I finally got it working perfectly and now I'm…
warspyking
  • 3,045
  • 4
  • 20
  • 37
0
votes
1 answer

C#-Lua UDP incompatibility (no message received)

My problem: A UDP message sent by a C# application (.NET 4.6.1) is not showing up in a Lua client (LOVE 0.9.2 with bundled LuaSocket). The send code is hilariously simple: UdpClient listener = new UdpClient(port); listener.Send(bytes, bytes.Length,…
Pixel
  • 35
  • 3
0
votes
1 answer

how can I connect to an url adress using luasocket?

This is my code: socket = require('socket') conn = socket.connect('http://chat.freenode.net', 6667) if conn == true then print('connected') else print('error') end I even tried to put http in the url but it doesn't work
0
votes
2 answers

How to use ZeroBrane Studio IDE debugger when lua is compiled as c++

I have compiled Lua 5.3 as a 32 bit c++ DLL and exe. The DLL contains all the lua code except for lua.cpp and luac.cpp. The exe compiles lua.cpp and uses the DLL to run the lua interpreter. This works fine when running on its own from the command…
0
votes
1 answer

How To Require Lua Socket?

I'm very new to lua development with file manipulation, and now trying to import the lua socket package into my project according to this post, but I can't run even the code below. I guess the error message indicates I need to import not only the…
kemakino
  • 1,041
  • 13
  • 33
0
votes
0 answers

LuaSocket TCP client can receive messages from server, but not vice versa

My client receives every message from the server just fine after connecting, but the server's output is always this: Client #1 connected. first packet error: timeout Looping client #1 message error: timeout Looping client #1 message error:…
Accumulator
  • 873
  • 1
  • 13
  • 34
0
votes
1 answer

Luasocket - How to send/receive UDP broadcast messages?

I've been trying to do this for a while. I tried following this http://lua.2524044.n2.nabble.com/UDP-Broadcast-td3995269.html, but to no avail. I've successfully sent unicast messages between the client and server. I've confirmed my broadcast…
arcticmatt
  • 1,956
  • 1
  • 19
  • 36
0
votes
0 answers

PHP TCP-Server to LUA TCP-Client - irregular freezes

I only code as a hobby with little experience, a year ago I found that the Digital Combat Simulator (DCS, a military flight-sim) had a powerfull lua scripting interface which enabled us to introduce gameplay into a plain simulator. It became evident…
0
votes
1 answer

Lua client, Python server, everything's fine in local, timeout on the net

So, I'm coding a lua mod for Binding of Isaac. I made a lua client (using luasocket), and a python server. In local, everything works fine, but when I test it using my public ip (I did the port forwarding on my router), the lua client times out at…
DorianX
  • 1
  • 1
  • 4
0
votes
1 answer

Error using luasocket in Eclipse (Ubuntu 16.04)

I'm trying to use Lua 5.1 with luasocket in Eclipse Luna installed at Ubuntu 16.04. I've already installed Lua 5.1 and LuaSocket 3.0-rc1 and I can run this program from command line (lua main.lua): print(_VERSION) print("Path:…
Alex8752
  • 597
  • 5
  • 12
0
votes
1 answer

Why would a web server reply with 301 and the exact location that was requested?

I'm trying to retrieve pages from a web server via https, using lua with luasec. For most pages my script works as intended, but if the ressource contains special characters (like ,'é), I'm being sent into a loop with 301 responses. let this code…
0
votes
2 answers

Communicate server port to client? (TCP)

Problem Following LuaSocket Introduction I managed to get the server running. I also managed to connect from the client side. But to get this connection the client must know the server port number. In the example code the server port is 0, which…
Siemkowski
  • 1,351
  • 5
  • 15
  • 32
0
votes
1 answer

"socket.core" is not a valid Win32 application

After Reading this, downloading the x64 binary of socket and replacing them in the lua "clibs" directory, with no positive results, I would like some help on resolving the following error that i'm receiving from eclipse: Exception in thread "main"…
Ygor Montenegro
  • 659
  • 1
  • 12
  • 26