mirror of
https://github.com/koush/scrypted.git
synced 2026-02-12 18:12:04 +00:00
client: use default transports
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user