In your computer / Node.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain', 'Content-Length': 'Hello World\n'.length});
res.end('Hello World\n');
}).listen(4444);
console.log('Server running at http://localhost:4444/');
Tessel:
var tessel = require('tessel')
, net = require('net');
console.log('opening tcp socket');
// IP address of the computer you deployed from (local network)
var ip = process.env.DEPLOY_IP;
console.log('connecting to', ip);
var client = net.connect(4444, ip, function () {
console.log('writing GET request');
client.write("GET / HTTP/1.0\r\nAccept: *\/*\r\nHost: m.google.com\r\n\r\n");
});
client.on('data', function (buf) {
// return data
console.log(buf);
})