lua code would be nice too
relay=0
srv=net.createServer(net.TCP)
srv:listen(8080,function(conn)
conn:on("receive",function(conn,pl)
gpio.mode(5,gpio.OUTPUT)
if string.find(pl,"gpio5=0") then gpio.write(5,0) relay=0 end
if string.find(pl,"gpio5=1") then gpio.write(5,1) relay=1 end
conn:send(relay)
conn:on("sent",function(conn) conn:close() end)
end)
end)