First - many thanks to the authors of NodeMcu, really promising!
Now my problem: The sample code below works fine but leaks about 100-300bytes of memory on every request - finally crashing the module. Is there a workaround or is this a bug? I know I could solve it by sending the "Content-length:" header but the 'real' server will serve dynamic content and it would be expensive to calculate the length in advance...
Thomas
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n")
-- conn:send("Content-length: 25\r\n")
conn:send("Connection: close\r\n\r\n")
conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap())
conn:close()
end)
end)