intesso / connect-livereload

connect middleware for adding the livereload script to the response
MIT License
305 stars 53 forks source link

Conflict with "cookie-session" #41

Closed pensierinmusica closed 9 years ago

pensierinmusica commented 10 years ago

Please see https://github.com/expressjs/cookie-session/issues/14

Thanks!

andineck commented 10 years ago

You are right, this is something that needs to be fixed in connect-livereload. cookie-session and connect-livereload both overwrite the http writeHead function. connect-livereload in this version loads the original function back after it is done, and therefore overwrites the (extended version by cookie-session) when it was loaded before connect-livereload.

Needs to be changed...

In the meantime load the cookie-session middleware after connect-livereload.

kennu commented 10 years ago

I am also having this problem with express-session and it seems to be fixed by moving connect-livereload to the end of all middlewares.

Fishrock123 commented 10 years ago

As doug mentioned in the cookie-session thread, the lines in question are index.js L94-L98.

joshperry commented 9 years ago

Happy to spend some time on this issue, considering it wasted almost a day for me already. Anyone have a good strategy in mind for fixing this issue?

andineck commented 9 years ago

@joshperry : Can you test if branch binary-files works well together with cookie-session? The restore() function has been removed in this version. A unit test for this would be welcome too :-)

joshperry commented 9 years ago

@andi-neck Yeah, let me give it a try.

joshperry commented 9 years ago

When using that branch, livereload does not interfere with the session anymore, but the livereload functionality doesn't work either.

The livereload websocket connects properly and the info and hello frames are sent, but no frames are sent when I change a file.

andineck commented 9 years ago

pushed to npm v0.5.2, thx to @joshperry