Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting cookie header to be sent on handshake if HTTP is initially used #393

Closed
tirithen opened this issue May 22, 2015 · 2 comments
Closed

Comments

@tirithen
Copy link

I'm working in a project where we use passport for authentication. To bridge the authentication to socket.io/engine.io instead we use passport.socketio package. This works great in the browser as the available cookies are sent in the initial socket.io/engine.io handshake that is done via HTTP.

When we try write tests with mocha for the socket API how ever by first logging in via passport HTTP call with the module request we cannot find a way to pass the received session cookie along with the socket.io-client (that uses engine.io-client) initial connection. Hence we cannot find a way to write these tests in mocha.

Is there a way to set additional headers to be sent in the handshake or to share a cookie jar between the request and socket connection?

(there is an outdated "hack" solution but it is not working any more jfromaniello/passport.socketio#72)

@dooglus
Copy link

dooglus commented Jul 20, 2015

It looks to me like #379 does what you need by letting you specify a extraHeaders option.

@nkzawa
Copy link
Contributor

nkzawa commented Jan 16, 2016

please use the extraHeaders option for node.js.

@nkzawa nkzawa closed this as completed Jan 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants