node-pusher icon indicating copy to clipboard operation
node-pusher copied to clipboard

http.createClient is deprecated in node.js v0.8+

Open klkim opened this issue 13 years ago • 0 comments

When http.createClient is deprecated in node.js v0.8+, the revised source code of node-puser.js is as follows. Please check it out.

Original: var client = http.createClient(80, this.domain);
var request = client.request('POST', path, { 'host': this.domain, 'content-type': 'application/json', 'content-length': new Buffer(requestBody).toString('binary').length });

Revised: var _options = { host: this.domain, port: 80, path: path, method: 'POST', 'content-type': 'application/json', 'content-length': new Buffer(requestBody).toString('binary').length } var request = http.request(_options, function(res) {});

klkim avatar Aug 09 '12 01:08 klkim