Compare commits

..

8 Commits

Author SHA1 Message Date
4b0fb073e6 2.0.14 2022-12-29 13:28:11 +01:00
fc458b6827 fix(core): update 2022-12-29 13:28:11 +01:00
f27b9f8143 2.0.13 2022-12-29 11:18:16 +01:00
38058aba57 fix(core): update 2022-12-29 11:18:15 +01:00
ba38dae64f 2.0.12 2022-12-28 19:51:09 +01:00
69e862a6cf fix(core): update 2022-12-28 19:51:09 +01:00
4562ac355b 2.0.11 2022-12-28 14:02:15 +01:00
b029dc191e fix(core): update 2022-12-28 14:02:14 +01:00
5 changed files with 26 additions and 17 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartsocket", "name": "@pushrocks/smartsocket",
"version": "2.0.10", "version": "2.0.14",
"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",
@ -26,7 +26,7 @@
"@pushrocks/isounique": "^1.0.5", "@pushrocks/isounique": "^1.0.5",
"@pushrocks/lik": "^6.0.0", "@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdelay": "^2.0.13", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartenv": "^5.0.2", "@pushrocks/smartenv": "^5.0.4",
"@pushrocks/smartexpress": "^4.0.18", "@pushrocks/smartexpress": "^4.0.18",
"@pushrocks/smartjson": "^5.0.1", "@pushrocks/smartjson": "^5.0.1",
"@pushrocks/smartlog": "^3.0.1", "@pushrocks/smartlog": "^3.0.1",
@ -38,6 +38,7 @@
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.63", "@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbundle": "^2.0.7",
"@gitzone/tsrun": "^1.2.37", "@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.72", "@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^5.0.4", "@pushrocks/tapbundle": "^5.0.4",

24
pnpm-lock.yaml generated
View File

@ -3,13 +3,14 @@ lockfileVersion: 5.4
specifiers: specifiers:
'@apiglobal/typedrequest-interfaces': ^2.0.1 '@apiglobal/typedrequest-interfaces': ^2.0.1
'@gitzone/tsbuild': ^2.1.63 '@gitzone/tsbuild': ^2.1.63
'@gitzone/tsbundle': ^2.0.7
'@gitzone/tsrun': ^1.2.37 '@gitzone/tsrun': ^1.2.37
'@gitzone/tstest': ^1.0.72 '@gitzone/tstest': ^1.0.72
'@pushrocks/isohash': ^2.0.0 '@pushrocks/isohash': ^2.0.0
'@pushrocks/isounique': ^1.0.5 '@pushrocks/isounique': ^1.0.5
'@pushrocks/lik': ^6.0.0 '@pushrocks/lik': ^6.0.0
'@pushrocks/smartdelay': ^2.0.13 '@pushrocks/smartdelay': ^2.0.13
'@pushrocks/smartenv': ^5.0.2 '@pushrocks/smartenv': ^5.0.4
'@pushrocks/smartexpress': ^4.0.18 '@pushrocks/smartexpress': ^4.0.18
'@pushrocks/smartjson': ^5.0.1 '@pushrocks/smartjson': ^5.0.1
'@pushrocks/smartlog': ^3.0.1 '@pushrocks/smartlog': ^3.0.1
@ -27,7 +28,7 @@ dependencies:
'@pushrocks/isounique': 1.0.5 '@pushrocks/isounique': 1.0.5
'@pushrocks/lik': 6.0.0 '@pushrocks/lik': 6.0.0
'@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartexpress': 4.0.22 '@pushrocks/smartexpress': 4.0.22
'@pushrocks/smartjson': 5.0.5 '@pushrocks/smartjson': 5.0.5
'@pushrocks/smartlog': 3.0.2 '@pushrocks/smartlog': 3.0.2
@ -39,6 +40,7 @@ dependencies:
devDependencies: devDependencies:
'@gitzone/tsbuild': 2.1.65 '@gitzone/tsbuild': 2.1.65
'@gitzone/tsbundle': 2.0.7
'@gitzone/tsrun': 1.2.39_@types+node@18.11.18 '@gitzone/tsrun': 1.2.39_@types+node@18.11.18
'@gitzone/tstest': 1.0.74_@types+node@18.11.18 '@gitzone/tstest': 1.0.74_@types+node@18.11.18
'@pushrocks/tapbundle': 5.0.4 '@pushrocks/tapbundle': 5.0.4
@ -328,7 +330,7 @@ packages:
/@pushrocks/isohash/2.0.0: /@pushrocks/isohash/2.0.0:
resolution: {integrity: sha512-a6Vktczk0Q39hBYTuAFqa12QNhy5GcFYhnJ5pqzpE5r3rj3FSS8HLqsoBUwB3b9YHGKYnbky9C3YNhMmFvoLPg==} resolution: {integrity: sha512-a6Vktczk0Q39hBYTuAFqa12QNhy5GcFYhnJ5pqzpE5r3rj3FSS8HLqsoBUwB3b9YHGKYnbky9C3YNhMmFvoLPg==}
dependencies: dependencies:
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smarthash': 2.1.10 '@pushrocks/smarthash': 2.1.10
/@pushrocks/isounique/1.0.5: /@pushrocks/isounique/1.0.5:
@ -408,8 +410,8 @@ packages:
dependencies: dependencies:
'@pushrocks/smartpromise': 3.1.7 '@pushrocks/smartpromise': 3.1.7
/@pushrocks/smartenv/5.0.3: /@pushrocks/smartenv/5.0.4:
resolution: {integrity: sha512-/cgEDhOIo9LB5Vd2BVO9+QrjC38w872iy7w88UWuwz7obVILWOHl3MYMHAKFqXexuwKpQ/y/Klu2xQHtOPgi6Q==} resolution: {integrity: sha512-/fVIgZ9LY0GkJQFQwTC06nqFEJhZeuJapa6SeQs3WGkGkgYeWO3DTscwxtUpZULUn7geuAFQrk+vW+lErXiksQ==}
dependencies: dependencies:
'@pushrocks/smartpromise': 3.1.7 '@pushrocks/smartpromise': 3.1.7
@ -441,7 +443,7 @@ packages:
'@apiglobal/typedsocket': 2.0.12 '@apiglobal/typedsocket': 2.0.12
'@pushrocks/lik': 6.0.0 '@pushrocks/lik': 6.0.0
'@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartfeed': 1.0.11 '@pushrocks/smartfeed': 1.0.11
'@pushrocks/smartfile': 10.0.5 '@pushrocks/smartfile': 10.0.5
'@pushrocks/smartmanifest': 1.0.8 '@pushrocks/smartmanifest': 1.0.8
@ -696,7 +698,7 @@ packages:
'@pushrocks/isounique': 1.0.5 '@pushrocks/isounique': 1.0.5
'@pushrocks/lik': 6.0.0 '@pushrocks/lik': 6.0.0
'@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartexpress': 4.0.22 '@pushrocks/smartexpress': 4.0.22
'@pushrocks/smartjson': 5.0.5 '@pushrocks/smartjson': 5.0.5
'@pushrocks/smartlog': 3.0.2 '@pushrocks/smartlog': 3.0.2
@ -735,7 +737,7 @@ packages:
resolution: {integrity: sha512-g9a/Mfj+eJAUrTDQoH3oaYegjI98WlVoSLAI8lpExQ/STlEJGO5ZdWDqgZ0HvHe+5UeWvxzCFpHifqRhMUJ+dQ==} resolution: {integrity: sha512-g9a/Mfj+eJAUrTDQoH3oaYegjI98WlVoSLAI8lpExQ/STlEJGO5ZdWDqgZ0HvHe+5UeWvxzCFpHifqRhMUJ+dQ==}
dependencies: dependencies:
'@pushrocks/isounique': 1.0.5 '@pushrocks/isounique': 1.0.5
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@types/randomatic': 3.1.3 '@types/randomatic': 3.1.3
buffer: 6.0.3 buffer: 6.0.3
crypto-random-string: 4.0.0 crypto-random-string: 4.0.0
@ -806,7 +808,7 @@ packages:
dependencies: dependencies:
'@open-wc/testing': 3.1.7 '@open-wc/testing': 3.1.7
'@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartexpect': 1.0.14 '@pushrocks/smartexpect': 1.0.14
'@pushrocks/smartpromise': 3.1.7 '@pushrocks/smartpromise': 3.1.7
'@pushrocks/smarttime': 3.0.50 '@pushrocks/smarttime': 3.0.50
@ -821,7 +823,7 @@ packages:
dependencies: dependencies:
'@adobe/helix-fetch': 3.1.2 '@adobe/helix-fetch': 3.1.2
'@pushrocks/smartdelay': 2.0.13 '@pushrocks/smartdelay': 2.0.13
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartjson': 5.0.5 '@pushrocks/smartjson': 5.0.5
'@pushrocks/smartpromise': 3.1.7 '@pushrocks/smartpromise': 3.1.7
'@pushrocks/webstore': 2.0.5 '@pushrocks/webstore': 2.0.5
@ -833,7 +835,7 @@ packages:
dependencies: dependencies:
'@apiglobal/typedrequest-interfaces': 1.0.20 '@apiglobal/typedrequest-interfaces': 1.0.20
'@pushrocks/lik': 6.0.0 '@pushrocks/lik': 6.0.0
'@pushrocks/smartenv': 5.0.3 '@pushrocks/smartenv': 5.0.4
'@pushrocks/smartjson': 5.0.5 '@pushrocks/smartjson': 5.0.5
'@pushrocks/smartpromise': 3.1.7 '@pushrocks/smartpromise': 3.1.7
'@pushrocks/smartrx': 2.0.27 '@pushrocks/smartrx': 2.0.27

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartsocket', name: '@pushrocks/smartsocket',
version: '2.0.10', version: '2.0.14',
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);

View File

@ -96,11 +96,11 @@ export class SmartsocketClient {
webUrlArg: 'https://cdn.jsdelivr.net/npm/socket.io-client@4/dist/socket.io.js', webUrlArg: 'https://cdn.jsdelivr.net/npm/socket.io-client@4/dist/socket.io.js',
getFunction: () => { getFunction: () => {
const socketIoBrowserModule = (globalThis as any).io; const socketIoBrowserModule = (globalThis as any).io;
console.log('loaded socket.io for browser'); // console.log('loaded socket.io for browser');
console.log(socketIoBrowserModule);
return socketIoBrowserModule; return socketIoBrowserModule;
}, },
}); });
// console.log(socketIoClient);
logger.log('info', 'trying to connect...'); logger.log('info', 'trying to connect...');
const socketUrl = `${this.serverUrl}:${this.serverPort}`; const socketUrl = `${this.serverUrl}:${this.serverPort}`;
this.socketConnection = new SocketConnection({ this.socketConnection = new SocketConnection({