Compare commits

..

6 Commits

Author SHA1 Message Date
a8c647c5c7 1.1.32 2019-04-24 17:17:36 +02:00
22472e0adf fix(core): update 2019-04-24 17:17:36 +02:00
333ddb4d9c 1.1.31 2019-04-24 17:10:52 +02:00
126f020bf8 fix(core): update 2019-04-24 17:10:51 +02:00
7677b1bb48 1.1.30 2019-04-24 16:09:01 +02:00
114379c5b3 fix(core): update 2019-04-24 16:09:01 +02:00
6 changed files with 1058 additions and 88 deletions

13
.snyk
View File

@ -1,4 +1,13 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.3
ignore: {}
version: v1.13.5
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-JSYAML-173999:
- '@pushrocks/smartexpress > @pushrocks/smartfile > js-yaml':
reason: None given
expires: '2019-05-24T15:16:11.291Z'
SNYK-JS-JSYAML-174129:
- '@pushrocks/smartexpress > @pushrocks/smartfile > js-yaml':
reason: None given
expires: '2019-05-24T15:16:11.291Z'
patch: {}

1108
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartsocket",
"version": "1.1.29",
"version": "1.1.32",
"description": "easy and secure websocket communication",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -21,6 +21,7 @@
"dependencies": {
"@pushrocks/lik": "^3.0.5",
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartexpress": "^3.0.18",
"@pushrocks/smarthash": "^2.0.4",
"@pushrocks/smartlog": "^2.0.19",
"@pushrocks/smartpromise": "^3.0.2",

View File

@ -29,7 +29,9 @@ export class Smartsocket {
}
// tslint:disable-next-line:member-ordering
public setExternalServer = this.socketServer.setExternalServer;
public async setExternalServer (serverType: 'smartexpress', serverArg: any) {
await this.socketServer.setExternalServer(serverType, serverArg);
}
/**
* starts smartsocket

View File

@ -23,12 +23,9 @@ export class SocketServer {
* starts the server with another server
* also works with an express style server
*/
public async setExternalServer(serverType: 'express' | 'http', serverArg: any) {
if (serverType === 'http') {
this.httpServer = serverArg;
} else if (serverType === 'express') {
this.expressServer = serverArg;
}
public async setExternalServer(serverType: 'smartexpress', serverArg: plugins.smartexpress.Server) {
await serverArg.startedPromise;
this.httpServer = serverArg.httpServer;
}
/**
@ -37,14 +34,10 @@ export class SocketServer {
public getServerForSocketIo() {
if (this.httpServer) {
return this.httpServer;
} else if (this.expressServer) {
return this.expressServer;
} else if (!this.httpServer && !this.expressServer) {
} else {
this.httpServer = new http.Server();
this.standaloneServer = true;
return this.httpServer;
} else {
throw new Error('no server specified!');
}
}

View File

@ -2,9 +2,10 @@ import * as lik from '@pushrocks/lik';
import * as smartlog from '@pushrocks/smartlog';
import * as smarthash from '@pushrocks/smarthash';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartexpress from '@pushrocks/smartexpress';
import * as smartpromise from '@pushrocks/smartpromise';
import * as shortid from 'shortid';
import * as socketIo from 'socket.io';
import * as socketIoClient from 'socket.io-client';
export { lik, smartlog, smarthash, smartdelay, smartpromise, shortid, socketIo, socketIoClient };
export { lik, smartlog, smarthash, smartdelay, smartexpress, smartpromise, shortid, socketIo, socketIoClient };