This fires up a web server and attempts to listen to DNS requests on port 53:
var counter = 1; var wifi=require("wifi"); wifi.startAP('ESP'); function getPage(req,res) { console.log(req.url); res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<html><head><meta http-equiv="refresh" content="5"></head><body><img src="favicon.ico"/>'+(counter++)+'</body></html>'); res.end(); } require("http").createServer(getPage).listen(80); var net=require('net'); function callbackdata(data) { console.log({data:data}); } net.createServer(callbackdata).listen(53);
@Wilberforce started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This fires up a web server and attempts to listen to DNS requests on port 53: