Workspaces refactor #86

Merged
norm merged 189 commits from refactor/workspaces into main 2022-08-28 14:46:45 +00:00
Showing only changes of commit d311f74349 - Show all commits

View file

@ -96,8 +96,10 @@ export default class Stream extends EventEmitter<StreamEvents> {
private nonSharedConnections: NonSharedConnection[] = [];
constructor(origin: string, user: { token: string; } | null, options?: {
WebSocket?: any;
}) {
super();
options = options || { };
const query = urlQuery({
i: user?.token,
@ -107,7 +109,8 @@ export default class Stream extends EventEmitter<StreamEvents> {
});
this.stream = new ReconnectingWebsocket(`${origin.replace('http://', 'ws://').replace('https://', 'wss://')}/streaming?${query}`, '', {
minReconnectionDelay: 1 // https://github.com/pladaria/reconnecting-websocket/issues/91
minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91
WebSocket: options.WebSocket
});
this.stream.addEventListener('open', this.onOpen);
this.stream.addEventListener('close', this.onClose);