Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var http = require("http");
- var ip = "192.168.1.12"; // "localhost";
- var port = 8888;
- console.log('HTTP Server on '+ip+':'+port);
- http.createServer(function(request, response) {
- console.log("Got request");
- var all_response_body = "";
- all_response_body += "START ";
- for (var i=0; i<20; i++) {
- all_response_body += Array(101).join("0");
- }
- all_response_body += " END";
- response.writeHead(200, {
- "Content-Type": "text/plain",
- "Content-Length": all_response_body.length
- });
- response.write(all_response_body);
- response.end();
- console.log("Response end.");
- }).listen(port, ip);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement