sockjs/sockjs-client

Request headers with xhr-polling

alinvdu opened this issue · 2 comments

We have an environment where we want to use xhr-polling by default without using websockets implementation. We set request headers on every POST request for authentication purposes, is it possible to somehow add request headers?

We don't support setting headers because not all transports support them.

Thank you for the response @brycekahle . Would it be possible to modify the options hash to contain some kind of xhr.polling.headers that are only taken into consideration when xhr-polling is used?

There are certain network environments in which we can't rely on web sockets at all, they are too restrictive. Unfortunately we can't fallback to long-polling since every API POST request needs to specify a request header. The authentication system is too convoluted to be changed, it will take months since it used across many systems so our only option is to modify the library to support the request header.