client: add eio transport options

This commit is contained in:
Koushik Dutta
2022-12-12 22:41:22 -08:00
parent 0fbc455a79
commit 463cd9e2c2
3 changed files with 7 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/client",
"version": "1.1.19",
"version": "1.1.20",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/client",
"version": "1.1.19",
"version": "1.1.20",
"license": "ISC",
"dependencies": {
"@scrypted/types": "^0.2.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/client",
"version": "1.1.19",
"version": "1.1.20",
"description": "",
"main": "dist/packages/client/src/index.js",
"scripts": {

View File

@@ -66,6 +66,7 @@ export interface ScryptedLoginOptions extends ScryptedConnectionOptions {
export interface ScryptedClientOptions extends Partial<ScryptedLoginOptions> {
pluginId: string;
clientName?: string;
transports?: string[];
}
function isRunningStandalone() {
@@ -198,6 +199,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
transports: options?.transports,
};
const explicitBaseUrl = baseUrl || `${globalThis.location.protocol}//${globalThis.location.host}`;
@@ -214,6 +216,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
transports: options?.transports,
};
let sockets: IOClientSocket[] = [];
@@ -252,6 +255,7 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
withCredentials: true,
extraHeaders,
rejectUnauthorized: false,
transports: options?.transports,
};
const check = new eio.Socket(explicitBaseUrl, webrtcEioOptions);
sockets.push(check);