When an HTTP client (such as a browser) sends a request to a server, it includes a User-Agent header that is intended to be read by the server for various purposes, like Content Negotiation.
It's important to note that you cannot set a request header in a response; headers are meant to be read and interpreted only. Additionally, the req object (IncomingMessage) passed to the createServer() callback is a Readable stream.
However, there is a way to include custom headers when initiating a request:
var headers = {'User-Agent': 'Ryan Dahl'};
http.request({hostname: 'nodejs.org', headers: headers}, function(res) {
});