|
var http = require('http'); |
|
var imgdata = [ |
|
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, |
|
0x00, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, |
|
0x00, 0x21, 0xf9, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, |
|
0x2c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, |
|
0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b |
|
]; |
|
var imgbuf = new Buffer(imgdata); |
|
|
|
http.createServer(function(request, response) { |
|
console.log(request); |
|
response.writeHead(200, { |
|
'Content-Type': 'image/gif', |
|
'Content-Length': imgdata.length, |
|
'Set-Cookie': ['type=hoge; domain=cookietest.cou929.nu; path=/'], |
|
'Cache-Control': 'private, no-cache, no-cache="Set-Cookie", proxy-revalidate' |
|
}); |
|
response.end(imgbuf); |
|
}).listen(5001); |