Compare commits

..

2 Commits

Author SHA1 Message Date
5b8f7514f4 1.0.11 2021-01-23 05:14:30 +00:00
53874a7772 fix(core): update 2021-01-23 05:14:29 +00:00
4 changed files with 8 additions and 7 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.10",
"version": "1.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedsocket",
"version": "1.0.10",
"version": "1.0.11",
"private": false,
"description": "a typedrequest extension supporting websockets",
"main": "dist_ts/index.js",

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

@@ -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',