Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
4fc09af779 | |||
f73d973383 | |||
d87a942ab3 | |||
60e8657467 | |||
5215be946e | |||
b9c67666fa | |||
4b0fb073e6 | |||
fc458b6827 |
17
package.json
17
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartsocket",
|
"name": "@pushrocks/smartsocket",
|
||||||
"version": "2.0.13",
|
"version": "2.0.17",
|
||||||
"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",
|
||||||
@ -24,17 +24,18 @@
|
|||||||
"@apiglobal/typedrequest-interfaces": "^2.0.1",
|
"@apiglobal/typedrequest-interfaces": "^2.0.1",
|
||||||
"@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.2",
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartenv": "^5.0.4",
|
"@pushrocks/smartenv": "^5.0.5",
|
||||||
"@pushrocks/smartexpress": "^4.0.18",
|
"@pushrocks/smartexpress": "^4.0.34",
|
||||||
"@pushrocks/smartjson": "^5.0.1",
|
"@pushrocks/smartjson": "^5.0.1",
|
||||||
"@pushrocks/smartlog": "^3.0.1",
|
"@pushrocks/smartlog": "^3.0.1",
|
||||||
"@pushrocks/smartpromise": "^3.1.7",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@pushrocks/smartrx": "^3.0.0",
|
"@pushrocks/smartrx": "^3.0.0",
|
||||||
"@pushrocks/smarttime": "^4.0.0",
|
"@pushrocks/smarttime": "^4.0.1",
|
||||||
"socket.io": "^4.5.1",
|
"engine.io": "6.3.1",
|
||||||
"socket.io-client": "^4.5.1"
|
"socket.io": "4.5.4",
|
||||||
|
"socket.io-client": "4.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.63",
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
@ -42,7 +43,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",
|
||||||
"@types/node": "^18.6.3"
|
"@types/node": "^18.15.11"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
"files": [
|
"files": [
|
||||||
|
1799
pnpm-lock.yaml
generated
1799
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartsocket',
|
name: '@pushrocks/smartsocket',
|
||||||
version: '2.0.13',
|
version: '2.0.17',
|
||||||
description: 'easy and secure websocket communication'
|
description: 'easy and secure websocket communication'
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,8 @@ export class Smartsocket {
|
|||||||
public socketFunctions = new plugins.lik.ObjectMap<SocketFunction<any>>();
|
public socketFunctions = new plugins.lik.ObjectMap<SocketFunction<any>>();
|
||||||
public socketRequests = new plugins.lik.ObjectMap<SocketRequest<any>>();
|
public socketRequests = new plugins.lik.ObjectMap<SocketRequest<any>>();
|
||||||
|
|
||||||
|
public eventSubject = plugins.smartrx.rxjs.Subject;
|
||||||
|
|
||||||
private socketServer = new SocketServer(this);
|
private socketServer = new SocketServer(this);
|
||||||
|
|
||||||
constructor(optionsArg: ISmartsocketConstructorOptions) {
|
constructor(optionsArg: ISmartsocketConstructorOptions) {
|
||||||
@ -37,7 +39,6 @@ export class Smartsocket {
|
|||||||
this.alias = plugins.isounique.uni(this.options.alias);
|
this.alias = plugins.isounique.uni(this.options.alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line:member-ordering
|
|
||||||
public async setExternalServer(serverType: 'smartexpress', serverArg: any) {
|
public async setExternalServer(serverType: 'smartexpress', serverArg: any) {
|
||||||
await this.socketServer.setExternalServer(serverType, serverArg);
|
await this.socketServer.setExternalServer(serverType, serverArg);
|
||||||
}
|
}
|
||||||
|
@ -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');
|
||||||
return socketIoBrowserModule;
|
return socketIoBrowserModule;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(socketIoClient);
|
// 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({
|
||||||
@ -110,7 +110,8 @@ export class SmartsocketClient {
|
|||||||
smartsocketHost: this,
|
smartsocketHost: this,
|
||||||
socket: await socketIoClient
|
socket: await socketIoClient
|
||||||
.connect(socketUrl, {
|
.connect(socketUrl, {
|
||||||
multiplex: false,
|
multiplex: true,
|
||||||
|
rememberUpgrade: true,
|
||||||
autoConnect: false,
|
autoConnect: false,
|
||||||
reconnectionAttempts: 0,
|
reconnectionAttempts: 0,
|
||||||
rejectUnauthorized: socketUrl.startsWith('https://localhost') ? false : true,
|
rejectUnauthorized: socketUrl.startsWith('https://localhost') ? false : true,
|
||||||
|
Reference in New Issue
Block a user