I was trying to create a WebSocket using the public SGW REST API call, “/{db}/_changes/”, on our Flutter Web app.
But it is not possible to set the required authentication SyncGatewaySession cookie using the Dart WebSocket API on Flutter. The WebSocket API on Flutter/dart does not allow setting cookie and headers (on web applications).
Are there any other ways to authenticate this call except using Basic Authentication and Cookie?
Please elaborate on how to create a WebSocket using this REST API call.
By the way, I am not sure if it’s possible to set a cookie header in WebSocket API using JavaScript either. It’s probably because of some known security issue.
Any help would be highly appreciated.
Thanks in advance