stephenlb / nodejuice

Automatic browser refresh on file change or update is what you can call it. NodeJuice is a set of tools which allows you to develop with a push connection to your web browser. JavaScript V8 Seeker Server and Web Server Gateway Interface. nodeJuice Seeker Server works with all other servers including Apache, Passenger, Nginx, Cherokee, and more. A web server isn't required, NodeJuice comes with one in case you forgot yours. It runs on NodeJS; a low level non-blocking network ready process with many capabilities. This is a tool that every web developer needs and has wanted for a very long time. IRC @ #node.js
http://nodejuice.com
Other
78 stars 3 forks source link

http.createClient is deprecated #7

Open adrinux opened 11 years ago

adrinux commented 11 years ago

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 commented 11 years ago

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?

stephenlb commented 11 years ago

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 notifications@github.comwrote:

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

adrinux commented 11 years ago

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 commented 11 years ago

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.

stephenlb commented 11 years ago

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

On Wed, Sep 5, 2012 at 8:33 AM, Adrian Simmons notifications@github.comwrote:

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

adrinux commented 11 years ago

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.

stephenlb commented 11 years ago

Deluxe! Request Accepted.

On Fri, Sep 7, 2012 at 4:11 AM, Adrian Simmons notifications@github.comwrote:

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