Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c08acd076e | |||
| c968de37d1 | |||
| 5b8f7514f4 | |||
| 53874a7772 |
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedsocket",
|
||||
"version": "1.0.10",
|
||||
"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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedsocket",
|
||||
"version": "1.0.10",
|
||||
"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": [
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -71,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',
|
||||
|
||||
Reference in New Issue
Block a user