nchan.js
nchan.js copied to clipboard
There should be an option for EventSource withCredentials (keyword CORS)
Hi, thanks for the great module and the accompanying JS library.
Right now it is not possible to initiate an EventSource connection with the withCredentials: true parameter.
The line 673 looks like this
this.listener = new EventSource(url);
Since the CORS intent must be indicated in the constructor and not later, it must be solved on this line.
this.listener = new EventSource(url, { withCredentials: true });
Users would probably want to have a choice, so maybe pass it through the opt array?
Thank you.
supported in master as of commit f8b276f9c58be7a5c38202933ccdbf8bc019c40d