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

how can i build luasocket on msys2

Am new to lua/luajit. I was looking for a socket api for lua, and luasocket came up in searches, pacman -Ss luasocket doesnt exist so I have to compile it from source. Have not been successful, I was wondering if anyone can provide a makefile to…
0
votes
0 answers

How to get LuaSocket udp6 to work for multicast

We have just had our game rejected by Apple as we do not support IPv6. We use Codea, a Lua IDE for iPad, which comes with LuaSocket 3.0, and therefore has tcp6() and udp6() extensions. We cannot get the udp6() broadcast/multicast to work... On the…
brookesi
  • 46
  • 4
0
votes
2 answers

when I write require("socket"), error occurs

when I write socket = require("socket") This error occurs. How can I fix this errors? maybe I think this problem is about luasocket. no field package.preload['socket.core'] no file '.\socket\core.lua' no file 'e:\Program…
Jiman An
  • 49
  • 7
0
votes
0 answers

LuaSocket dll loading error

I connected my project (C++ VS2015 & lua 5.3) to ZeroBrane IDE debugger via luasocket and all works like expected: package.path = package.path .. ';./scripts/zerobrane/?.lua' package.cpath = package.cpath .. ';./scripts/zerobrane/?.dll' local…
Alprog
  • 103
  • 2
  • 10
0
votes
2 answers

Trouble with Lua TCP server when using loop to receive and send messages multiple times

I need a client and server to communicate through a socket. The client tells the server that it wants a specific message (through a string "arquivo") and gets the message that is supposed to be 10KB long. Both of them have to maintain the connection…
eweiner
  • 1
  • 2
0
votes
2 answers

How to install luasockets on imx6 processor running openWRT linux

I am new to linux and am working on a project that uses a imx6 processor and has the openWRT linux distribution running on it. I am trying to send UDP messages to the processor using luasockets, but I am having trouble installing it installing it.…
KP123
  • 71
  • 9
0
votes
1 answer

How to build luasockets 3.0 for lua 5.3

I need to build lua-redis. Lua-dedis depends on luasockets. Luasockets 2.0 fail to build : my question on sockets 2.0 and lua 5.3 I was proposed to use luasockets 3.0. I make them, but they are installed into lua 5.1 and lua 5.3 still doesn't see…
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
0
votes
0 answers

Occasionally incomplete response from HTTP request

I'm downloading quite big JSON data with luasocket (request), but sometimes, data are incomplete. There is no pattern, if X runs, I have Y fails and Z successful downloads. My downloading code looks like this: local response = {} local one, code,…
Pavel Štěrba
  • 2,822
  • 2
  • 28
  • 50
0
votes
1 answer

socket.http headers in lua

I am using the socket.http module to send http request but I am unable to get all the response headers from the http request. Below is the sample code am using I need to print all the response headers Connection close, TE Content-Length …
0
votes
1 answer

Simple encryption in lua

I was wondering, what would be the easiest way to encrypt a message, into a 128-bit with a key. I wanted to code something on my personal computer, that would use LuaSocket, and based on what is sent to my PC, the computer executes X command. This…
Eliter
  • 153
  • 2
  • 10
0
votes
1 answer

lua 5.3 + luasocket 3.0rc1-2: undefined symbol: luaL_setfuncs

I have Luasocket 3.0rc1-2 installed through luarocks with Lua 5.3 running on the server. When I run a script requiring luasocket on nginx (1.8.0) with LuaJIT (2.1), it produces an error message: lua entry thread aborted: runtime error: error loading…
user479947
0
votes
2 answers

LuaSocket server don't accept clients

Im making a lua script running at my pc, and need to connect from my android. So in the lua script I just put this: local socket = require 'socket' local server = socket.tcp() print("createdserver") server:bind('*',7070) print("binded") while 1 do …
Caio Keto
  • 1,919
  • 4
  • 20
  • 30
0
votes
0 answers

LuaSocket identify what packet the client sends

I'm wondering if there's a way to see when the client sends a packet, what header it sends, and how I can deal with it. If in instance, a client sends a header like : 0xAA, how would I reply to that? This is what I currently have. socket =…
Xhalo7
  • 1
  • 3
0
votes
0 answers

How would I check email using gmail atom and Lua Socket?

I've had this working before, but I think whatever it is doing for IPV6 support now is breaking it. I'm not sure though. require "socket" require "socket.http" url = "https://username:password@gmail.google.com/­gmail/­feed/­atom" print…
Hal
  • 219
  • 2
  • 12
0
votes
1 answer

http.TIMEOUT is not working in lua

I'm doing a long poll request setting a timeout of 10 sec but it does not seem to be working. My understanding is if we don't get a response from backend within the specified timeout, backend call should end with timedout error code. Is it so? But…
Dilip
  • 628
  • 2
  • 10
  • 23
1 2 3
11
12