Skip to content

Instantly share code, notes, and snippets.

@josefsalyer
Created December 29, 2010 21:11
Show Gist options
  • Save josefsalyer/759074 to your computer and use it in GitHub Desktop.
Save josefsalyer/759074 to your computer and use it in GitHub Desktop.
https connection problem
client = http.createClient( 443, "go.urbanairship.com", true );
request = client.request( "GET", "/api/device_tokens/", { 'Host': "go.urbanairship.com", 'Authorization' : MASTERAUTH } );
request.end();
return request.on('error', function(e){ console.log("request error: " + e.stack ); });
return request.on('close', function() { console.log("CLOSED"); });
return request.on('response', function(response) {
sys.debug("RESPONSE");
return response.on('data', function(chunk) {
sys.debug("GOT DATA");
result += chunk;
});
return response.on('end', function() {
sys.debug("END");
return result;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment