////////////////////////////////////////////////////// //Stripped down node servers, with different clients //single line node js server require('http').createServer((req,res) => { res.writeHead(200);res.end('Hello world'); }).listen(8080); //telnet in to try it out, it'll look like this.... Davids-MacBook-Pro:nodeBasic davidsarmaholdings$ telnet localhost 8080 Trying ::1... Connected to localhost. Escape character is '^]'. GET / HTTP/1.1 HTTP/1.1 200 OK Date: Sun, 16 Oct 2016 15:36:20 GMT Connection: keep-alive Transfer-Encoding: chunked b Hello world 0 //////////////////////////////////////////////////// //or, if telnet is not available, use nc //here's a slightly modified server, and a nc client require('http').createServer((req,res) => { res.writeHead(200); res.end('Hello world'); console.log(req.url); }).listen(8080, () => { console.log('listening on port 8080') }); //and here's the nc session Davids-MacBook-Pro:nodeBasic davidsarmaholdings$ nc localhost 8080 GET / HTTP/1.1 HTTP/1.1 200 OK Date: Sun, 16 Oct 2016 15:53:30 GMT Connection: keep-alive Transfer-Encoding: chunked b Hello world 0 GET /foobar HTTP/1.1 HTTP/1.1 200 OK Date: Sun, 16 Oct 2016 15:54:02 GMT Connection: keep-alive Transfer-Encoding: chunked b Hello world 0 GET /foobar?q=madonna HTTP/1.1 HTTP/1.1 200 OK Date: Sun, 16 Oct 2016 15:55:38 GMT Connection: keep-alive Transfer-Encoding: chunked b Hello world 0