nodejuice icon indicating copy to clipboard operation
nodejuice copied to clipboard

http.createClient is deprecated

Open adrinux opened this issue 12 years ago • 7 comments

Getting an error whilst trying to get node juice working with a drupal site. sidekick seems to be working ok: { sidekicked: "dev.example.com:80" , code: 200 , ctype: "text/html; charset=utf-8" , type: "GET" , uri: "/" } But nothing appears in the browser window (Chrome reports Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.)

I also see this on console http.createClient is deprecated. Use http.request instead

Makes me wonder if nodejuice is broken on the latest stable node.js v0.8.8 ?

adrinux avatar Aug 31 '12 15:08 adrinux

A quick hack replacing http.createClient with http.request in library/utility.js and it's working:

//, request = http.createClient( port, host ) // .request( type, path, headers );
var options = {
    port     : setup.port     || 80
,   host     : setup.host     || 'localhost'
,   method   : setup.type     || 'GET'
,   path     : setup.path     || '/'
}
request = http.request(options);

I should probably work this up into a a proper patch – but I'm getting the impression this project is a bit dead. Is it?

adrinux avatar Aug 31 '12 16:08 adrinux

Hi Adrian!

The project is fairly stable, and I use it regularly. Thank you for the update on Request Upgrade.

On Fri, Aug 31, 2012 at 9:50 AM, Adrian Simmons [email protected]:

A quick hack replacing http.createClient with http.request in library/utility.js and it's working:

//, request = http.createClient( port, host ) // .request( type, path, headers );

var options = { port : setup.port || 80 , host : setup.host || 'localhost' , method : setup.type || 'GET' , path : setup.path || '/' } request = http.request(options);

I should probably work this up into a a proper patch – but I'm getting the impression this project is a bit dead. Is it?

— Reply to this email directly or view it on GitHubhttps://github.com/stephenlb/nodejuice/issues/7#issuecomment-8198106.

Cheers! Stephen Blum http://twitter.com/PubNub https://github.com/pubnub/pubnub-api - GitHub https://help.pubnub.com/ - Help Desk www.pubnub.com +1-425-830-6711

stephenlb avatar Sep 05 '12 03:09 stephenlb

Stability would explain the lack of activity, nice to know that project is still alive. I'm working up to a pull request for this change.

adrinux avatar Sep 05 '12 14:09 adrinux

Some background. In node.js 0.8.8 http.createClient is deprecated http://nodejs.org/api/http.html#http_http_createclient_port_host

Node docs don't seem to mention when it was deprecated, but there are other github posts mentioning its deprecation as far back as .0.4.x.

For me at least (using sidekick with apache), nodejuice is non-functional on node.js 0.8.8

I committed the changes described above to my fork in https://github.com/adrinux/nodejuice/commit/62b596c4cf8c20213734da4493f2c8eb96855c1a

Probably needs more work to be worth a pull request.

adrinux avatar Sep 05 '12 15:09 adrinux

Looks good! Bring on the Pull Request. :-)

On Wed, Sep 5, 2012 at 8:33 AM, Adrian Simmons [email protected]:

Some background. In node.js 0.8.8 http.createClient is deprecated http://nodejs.org/api/http.html#http_http_createclient_port_host

Node docs don't seem to mention when it was deprecated, but there are other github posts mentioning its deprecation as far back as .0.4.x.

For me at least (using sidekick with apache), nodejuice is non-functional on node.js 0.8.8

I committed the changes described above to my fork in https://github.com/adrinux/nodejuice/commit/62b596c4cf8c20213734da4493f2c8eb96855c1a

Probably needs more work to be worth a pull request.

— Reply to this email directly or view it on GitHubhttps://github.com/stephenlb/nodejuice/issues/7#issuecomment-8302963.

Cheers! Stephen Blum http://twitter.com/PubNub https://github.com/pubnub/pubnub-api - GitHub https://help.pubnub.com/ - Help Desk www.pubnub.com +1-425-830-6711

stephenlb avatar Sep 06 '12 03:09 stephenlb

Done. Still think it needs some tidying up. Maybe headers added to the options object, and some of the vars which were set and then used in http.createClient could perhaps be removed. Not familiar enough with the code (or enough of a programmer) to figure that out.

adrinux avatar Sep 07 '12 11:09 adrinux

Deluxe! Request Accepted.

On Fri, Sep 7, 2012 at 4:11 AM, Adrian Simmons [email protected]:

Done. Still think it needs some tidying up. Maybe headers added to the options object, and some of the vars which were set and then used in http.createClient could perhaps be removed. Not familiar enough with the code (or enough of a programmer) to figure that out.

— Reply to this email directly or view it on GitHubhttps://github.com/stephenlb/nodejuice/issues/7#issuecomment-8362385.

Cheers! Stephen Blum http://twitter.com/PubNub https://github.com/pubnub/pubnub-api - GitHub https://help.pubnub.com/ - Help Desk www.pubnub.com +1-425-830-6711

stephenlb avatar Sep 07 '12 18:09 stephenlb