Compare commits

..

6 Commits

Author SHA1 Message Date
c08acd076e 1.0.12 2021-01-23 06:04:02 +00:00
c968de37d1 fix(core): update 2021-01-23 06:04:02 +00:00
5b8f7514f4 1.0.11 2021-01-23 05:14:30 +00:00
53874a7772 fix(core): update 2021-01-23 05:14:29 +00:00
479cf60239 1.0.10 2021-01-23 04:51:49 +00:00
825a264327 fix(core): update 2021-01-23 04:51:48 +00:00
4 changed files with 12 additions and 14 deletions

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.9",
"version": "1.0.12",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -1950,9 +1950,9 @@
}
},
"@pushrocks/smartsocket": {
"version": "1.2.1",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.2.1.tgz",
"integrity": "sha512-vZTnkGFa8MpHrBO+87jzzy5XZYfi4VejzlqNnWmt1iXQx3lMitrvEcQPXWvqtwrI1WBysZhmk0AWB4VXbYWOSQ==",
"version": "1.2.2",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartsocket/-/smartsocket-1.2.2.tgz",
"integrity": "sha512-qx5xqlepEGYBTNg+tLjQTgmcxjyHdaysuFLcadxPHYkPdQF13LUnnpvNOeglCW2dgPKP4lIwIOLDyecMtz2ZWw==",
"requires": {
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/isohash": "^1.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.9",
"version": "1.0.12",
"private": false,
"description": "a typedrequest extension supporting websockets",
"main": "dist_ts/index.js",
@@ -25,7 +25,7 @@
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"@pushrocks/isohash": "^1.0.2",
"@pushrocks/smartexpress": "^3.0.100",
"@pushrocks/smartsocket": "^1.2.1",
"@pushrocks/smartsocket": "^1.2.2",
"@pushrocks/smartstring": "^3.0.24"
},
"browserslist": [

View File

@@ -33,7 +33,7 @@ tap.test('should add some handlers', async () => {
tap.test('should create Server and Client', async (tools) => {
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
testTypedSocketClient = await typedsocket.TypedSocket.createClient(testTypedRouter, 'http://localhost');
testTypedSocketClient = await typedsocket.TypedSocket.createClient(testTypedRouter, 'http://localhost:3000');
});
tap.test('should process messages from both sides', async () => {

View File

@@ -59,9 +59,6 @@ export class TypedSocket {
},
smartsocketServer
);
if (smartexpressServerArg && smartexpressServerArg.serverStatus !== 'running') {
await smartexpressServerArg.start()
}
await smartsocketServer.start();
return typedsocket;
@@ -74,15 +71,16 @@ export class TypedSocket {
): Promise<TypedSocket> {
const domain = new plugins.smartstring.Domain(serverUrlArg);
const smartsocketClient = new plugins.smartsocket.SmartsocketClient({
const socketOptions = {
alias: aliasArg,
role: publicRoleName,
password: publicRolePass,
port: domain.port || 3000,
url: `${domain.nodeParsedUrl.protocol}//${domain.nodeParsedUrl.host}`,
url: `${domain.nodeParsedUrl.protocol}//${domain.nodeParsedUrl.hostname}`,
autoReconnect: true,
});
}
console.log(socketOptions);
const smartsocketClient = new plugins.smartsocket.SmartsocketClient(socketOptions);
smartsocketClient.addSocketFunction(
new plugins.smartsocket.SocketFunction({
funcName: 'processMessage',