Skip to content

Instantly share code, notes, and snippets.

@aweeks
Created December 19, 2012 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aweeks/4333305 to your computer and use it in GitHub Desktop.
Save aweeks/4333305 to your computer and use it in GitHub Desktop.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(304, {'Transfer-Encoding': 'chunked'});
res.end();
}).listen(8000, '127.0.0.1');
OUTPUT:
$ printf "GET / HTTP/1.1\n\n" | netcat localhost 8000
HTTP/1.1 304 Not Modified
Transfer-Encoding: chunked
Date: Wed, 19 Dec 2012 00:05:09 GMT
Connection: keep-alive
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment