Skip to content

anonymous /gist:333511

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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.