eacaps / es6-actioncable

Port of actioncable code to ES6 and nodized it
The Unlicense
28 stars 7 forks source link

Support passing in headers to Action Cable #5

Closed ignu closed 7 years ago

ignu commented 8 years ago

Support an optional headers key on options.

(I currently need this for authentication from a native iOS app.)

eacaps commented 8 years ago

Sorry, I somehow missed this pull request, I'll incorporate in shortly

eacaps commented 8 years ago

Okay, this blew up in my face the first time I tried it. So I actually decided to implement it differently. If you specify your own method to create your websocket using the createWebsocket option, then you will have access to all the other options you passed in and can do whatever you please including

return new WebSocket(<url>, '', options.headers);