Skip to content

Instantly share code, notes, and snippets.

@whittle
Created October 19, 2011 22:45
Show Gist options
  • Save whittle/1299915 to your computer and use it in GitHub Desktop.
Save whittle/1299915 to your computer and use it in GitHub Desktop.
(function() {
var http = require('http');
var say_hello = function(request, response) {
var message = 'مرحبا العالم';
response.setHeader('Content-Type', 'text/plain; charset=utf-8');
response.setHeader('Content-Length', Buffer.byteLength(message, 'utf8'));
response.setHeader('X-Content-Character-Count', message.length);
response.write(message, 'utf8');
response.end();
};
var app = http.createServer(say_hello);
app.listen(3080);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment