Compare commits

..

2 Commits

Author SHA1 Message Date
f27b9f8143 2.0.13 2022-12-29 11:18:16 +01:00
38058aba57 fix(core): update 2022-12-29 11:18:15 +01:00
3 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsocket", "name": "@pushrocks/smartsocket",
"version": "2.0.12", "version": "2.0.13",
"description": "easy and secure websocket communication", "description": "easy and secure websocket communication",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartsocket', name: '@pushrocks/smartsocket',
version: '2.0.12', version: '2.0.13',
description: 'easy and secure websocket communication' description: 'easy and secure websocket communication'
} }

View File

@ -47,7 +47,13 @@ export class Smartsocket {
*/ */
public async start() { public async start() {
const socketIoModule = await this.smartenv.getSafeNodeModule('socket.io'); const socketIoModule = await this.smartenv.getSafeNodeModule('socket.io');
this.io = new socketIoModule.Server(await this.socketServer.getServerForSocketIo()); this.io = new socketIoModule.Server(await this.socketServer.getServerForSocketIo(), {
cors: {
allowedHeaders: '*',
methods: '*',
origin: '*',
}
});
await this.socketServer.start(); await this.socketServer.start();
this.io.on('connection', (socketArg) => { this.io.on('connection', (socketArg) => {
this._handleSocketConnection(socketArg); this._handleSocketConnection(socketArg);