client: use default transports

This commit is contained in:
Koushik Dutta
2022-06-17 09:28:50 -07:00
parent ed5429d7ff
commit 9c6a6c00a8

View File

@@ -105,16 +105,15 @@ export async function connectScryptedClient(options: ScryptedClientOptions): Pro
let socket: IOClientSocket;
const endpointPath = `/endpoint/${pluginId}`;
const eioOptions: Partial<SocketOptions> = {
transports: ["websocket", "polling"],
path: `${endpointPath}/engine.io/api`,
extraHeaders,
rejectUnauthorized: false,
};
const explicitBaseUrl = baseUrl || `${window.location.protocol}//${window.location.host}`;
console.log('local address connection disabled');
if (window.location.hostname !== 'localhost' && !ip.isPrivate(window.location.hostname) && addresses && !addresses.includes(explicitBaseUrl)) {
const publicEioOptions: Partial<SocketOptions> = {
transports: ["websocket", "polling"],
path: `${endpointPath}/public/engine.io/api`,
extraHeaders,
rejectUnauthorized: false,