onRequest(req, res) { var data = url.parse(req.url, true), page = data.query.page, userAgent = req.headers['user-agent']; res.setHeader("Set-Cookie", "p=" + page); res.setHeader("Content-Type","text/plain"); res.writeHead(200); res.end(userAgent); } http – чуть сложнее сервер http://nodejs.org/api/http.html