-->
Page 3 of 5

Re: Another web server

PostPosted: Wed Jan 07, 2015 9:17 am
by bradvoy
jankop wrote:I ran into a problem with the length of the HTML page during testing, . With a longer page server did not work. But with the new Lua (build 20150106) already it works perfectly. It's just a detriment that is not integrated parser for POST request too.


I'm glad you had better results with the newest firmware. There are a few things I'd still like to add to the code, including parsing of POST requests and proper URL-decoding of parameters.

Re: Another web server

PostPosted: Wed Jan 07, 2015 12:40 pm
by jankop
That would be great, I'm very bad programmer. I will be cheer!

Re: Another web server

PostPosted: Fri Jan 09, 2015 5:02 pm
by jankop
Today I met with this problem. Server is rebooted after receiving unintelligible query. I can not judge whether the fault is not in parser.
Code: Select allRequest received:    C   Ů"X„ŐJz
nil     (my comment - it is print(queryString)
PANIC: unprotected error in call to Lua API (httpServer.lua:21: bad argument #1 to 'find' (string expected, got nil))
PANIC: unprotected error in call to Lua API (bad argument #2 (string expected, got no value))
?)Ťý ¶ô@HĚ !ŠôDH
Šô@HŕBCá
NodeMCU 0.9.5 build 20150107  powered by Lua 5.1.4

Re: Another web server

PostPosted: Fri Jan 09, 2015 11:57 pm
by Hoksmur
Take a look here.
Now it can detect 404, send html, pht(one string script), lua file; various header for different files without increment requested memory . And more. See sources - 'as is' it isn't work, need run manualy yet: https://github.com/Hoksmur/uLuaNode/issues/1. User function has memory (full-5500) at best.