anonymous / gist:333511
Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:333511
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
var fs = require("fs");
var http = require("http");
 
var client = http.createClient(80, "google.com");
var request = client.request("GET", "/", {"host": "google.com"});
var file = fs.createWriteStream("google.html",
{ flags: "w",
mode: 0644 });
 
request.addListener("response", function(response) {
response.addListener("data", function(chunk) {
file.write(chunk);
});
response.addListener("end", function() {
file.close();
});
});
request.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.