mudlet luasocket

Post Reply
ryxen
Posts: 1
Joined: Sat Jan 23, 2016 7:53 pm

mudlet luasocket

Post by ryxen » Sat Jan 23, 2016 8:07 pm

Hi!

Sorry, the problem was that mudlet was started from SocksCap64, and my function was talking to a proxy which couldn't reach the local address.
I have made a custom rule in SocksCap64 and the script works perfectly.

I am using mudlet 2.1 in windows 8.1.
I would like to query information from a simple tcp server, so i copied the luasocket *.dll and *.lua files in the
%APPDATA%\Local\Mudlet directory, and wrote a simple client:

function get(name)
local socket = require("socket")
display(socket)
local sock = socket.connect("127.0.0.1",6666)
display(sock)
sock:settimeout(10)
local response = sock:send(name .. "\n")
display(response)
while 1 do
local response,msg = sock:receive("*l")
if (response == nil) then
echo(msg)
break
else
echo(response)
end
end
end

The function seems to work, at least nothing shows up in the errorlog.
The problem is that the sent message doesn't show up in the wireshark logs, and in the tcp server logs.
The same code works perfectly under linux from commandline, replacing echo with print and deleting the display lines.

I really need some help with this, because i am stuck.
Thanks.


Output:
lua get_object2("blahblah")
{
sleep = "function: 07A7A258",
source = "function: 07E55B00",
newtry = "function: 07A79B58",
_VERSION = "LuaSocket 2.0.2",
connect = "function: 07A77E78",
sink = "function: 07E55CB8",
__unload = "function: 07A79B18",
bind = "function: 07A77D78",
_M = <cycle>,
_DEBUG = true,
skip = "function: 07A79CF8",
dns = {
gethostname = "function: 07A79E98",
tohostname = "function: 07A79FF8",
toip = "function: 07A7A278"
},
gettime = "function: 07A7A1D8",
select = "function: 07A77B98",
url = {
unescape = "function: 0993F9A8",
_PACKAGE = "socket.",
escape = "function: 0790D6F0",
_VERSION = "URL 1.0.1",
build_path = "function: 0993FD18",
_NAME = "socket.url",
parse = "function: 0993FA98",
parse_path = "function: 0993FBD8",
_M = <cycle>,
absolute = "function: 0993FAC0",
build = "function: 0790D570"
},
BLOCKSIZE = 2048,
sinkt = {
default = "function: 07A77BF8",
["close-when-done"] = "function: 07A77CF8",
["keep-open"] = "function: 07A77BF8"
},
sourcet = {
["by-length"] = "function: 08418978",
default = "function: 07E55808",
["until-closed"] = "function: 07E55808"
},
tcp = "function: 07A76D98",
_NAME = "socket",
choose = "function: 07A77BB8",
try = "function: 08418888",
protect = "function: 07A79F38",
_PACKAGE = "",
udp = "function: 07A77E18"
}
tcp{client}: 0AF2B048

18

closed

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 12 guests