Only one tcp server allowed ESP8266 with Lua
snippet in lua

Only one tcp server allowed ESP8266 with Lua

user8473

if srv~=nil then
  srv:close()
end

srv=net.createServer(net.TCP) 
srv:listen(80,function(conn) 
    conn:on("receive",function(conn,payload) 
    print(payload) 
    conn:send("<h1> Hello, World.</h1>")
    end) 
end)