fix(core): update

This commit is contained in:
2022-01-19 18:36:13 +01:00
parent 12d7310b90
commit 9435796333
7 changed files with 26 additions and 286 deletions

View File

@@ -91,7 +91,13 @@ export class SmartsocketClient {
public async connect() {
const done = plugins.smartpromise.defer();
const smartenvInstance = new plugins.smartenv.Smartenv();
const socketIoClient = plugins.socketIoClient;
const socketIoClient: any = await smartenvInstance.getEnvAwareModule({
nodeModuleName: 'socket.io-client',
webUrlArg: 'https://cdn.jsdelivr.net/npm/socket.io-client@4/dist/socket.io.js',
getFunction: () => {
return (globalThis as any).io;
},
});
logger.log('info', 'trying to connect...');
const socketUrl = `${this.serverUrl}:${this.serverPort}`;
this.socketConnection = new SocketConnection({