Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
a8c647c5c7 | |||
22472e0adf | |||
333ddb4d9c | |||
126f020bf8 | |||
7677b1bb48 | |||
114379c5b3 |
13
.snyk
13
.snyk
@ -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
1108
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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!');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 };
|
||||
|
Reference in New Issue
Block a user