{"id":38699084,"url":"https://github.com/research-virtualfortknox/msb-client-websocket-nodejs","last_synced_at":"2026-01-17T10:44:42.883Z","repository":{"id":34240868,"uuid":"172461702","full_name":"research-virtualfortknox/msb-client-websocket-nodejs","owner":"research-virtualfortknox","description":"The nodeJs client library to connect to the websocket interface of the MSB (Manufacturing Service Bus)","archived":false,"fork":false,"pushed_at":"2025-07-17T15:39:59.000Z","size":1124,"stargazers_count":7,"open_issues_count":10,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-16T21:40:59.976Z","etag":null,"topics":["msb","msb-client","msb-client-websocket","nodejs","websocket-interface"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/research-virtualfortknox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-25T08:06:23.000Z","updated_at":"2025-07-17T15:40:02.000Z","dependencies_parsed_at":"2024-06-18T05:40:08.267Z","dependency_job_id":"1cf04ffd-a30b-44c3-b730-e3b96c1485e7","html_url":"https://github.com/research-virtualfortknox/msb-client-websocket-nodejs","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/research-virtualfortknox/msb-client-websocket-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/research-virtualfortknox%2Fmsb-client-websocket-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/research-virtualfortknox%2Fmsb-client-websocket-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/research-virtualfortknox%2Fmsb-client-websocket-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/research-virtualfortknox%2Fmsb-client-websocket-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/research-virtualfortknox","download_url":"https://codeload.github.com/research-virtualfortknox/msb-client-websocket-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/research-virtualfortknox%2Fmsb-client-websocket-nodejs/sbom","scorecard":{"id":771707,"data":{"date":"2025-08-11","repo":{"name":"github.com/research-virtualfortknox/msb-client-websocket-nodejs","commit":"ba2fb28cc78c6f22705f129bd13ef488f9c0f75f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/research-virtualfortknox/msb-client-websocket-nodejs/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/research-virtualfortknox/msb-client-websocket-nodejs/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/research-virtualfortknox/msb-client-websocket-nodejs/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/research-virtualfortknox/msb-client-websocket-nodejs/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/research-virtualfortknox/msb-client-websocket-nodejs/build.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/build.yml:29"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-75v8-2h7p-7m2m","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T02:24:30.972Z","repository_id":34240868,"created_at":"2025-08-23T02:24:30.972Z","updated_at":"2025-08-23T02:24:30.972Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28506593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T10:25:30.148Z","status":"ssl_error","status_checked_at":"2026-01-17T10:25:29.718Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["msb","msb-client","msb-client-websocket","nodejs","websocket-interface"],"created_at":"2026-01-17T10:44:42.121Z","updated_at":"2026-01-17T10:44:42.875Z","avatar_url":"https://github.com/research-virtualfortknox.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://research.virtualfortknox.de\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg src=\"https://research.virtualfortknox.de/static/cms/img/vfk_research_logo.png\" alt=\"VFK Research Logo\" height=\"70\" \u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# MSB websocket client library for NodeJS\n\n![Build Status](https://github.com/research-virtualfortknox/msb-client-websocket-nodejs/actions/workflows/build.yml/badge.svg)\n[![npm version](https://badge.fury.io/js/%40vfk_research%2Fmsb-client-websocket-nodejs.svg)](https://badge.fury.io/js/%40vfk_research%2Fmsb-client-websocket-nodejs)\n[![Coverage Status](https://coveralls.io/repos/github/research-virtualfortknox/msb-client-websocket-nodejs/badge.svg?branch=feature-coveralls)](https://coveralls.io/github/research-virtualfortknox/msb-client-websocket-nodejs?branch=feature-coveralls)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs?ref=badge_shield)\n\n**Compatibility Matrix**\n\nClient version compatibility to MSB versions:\n\n| | **1.5.x-RELEASE** | **1.6.x-RELEASE** |\n|---|:---:|:---:|\n| 1.0.x       | x | x |\n\n## Welcome\n\nIf you want to contribute, please read the [Contribution Guidelines](.github/CONTRIBUTING.md).\n\nIf you want to test this client by using its sources and a sample app, read the [App Sample](doc/app_sample.md).\n\nIf you want to know how to use this client in your own project, read below.\n\n## What is VFK MSB\n\nTODO: Link to general documentation about VFK MSB\n\nYou can use this client to connect a node app to VFK MSB.\n\n## Prerequisites\n\n* nodeJs and npm installed: https://nodejs.org/en/\n* MSB client npm package installed\n\nInstall npm package\n\n```sh\nnpm install --save @vfk_research/msb-client-websocket-nodejs\n```\n\nImport to your applicaton\n\n```js\nvar MsbClient = require('@vfk_research/msb-client-websocket-nodejs');\n```\n\n## Create self-description\n\nThe figure below shows a minimal required `self-description model` of a smart object / application.\nEvery smart object / application requires (must have) a uuid and a token.\nThe uuid is competent for identification\nand the token is used to verify the smart object / application for its owner on the MSB side.\n\n![Self Description](doc/images/self-description.png)\n\nTODO: Here you can find more information about\nthe `self-description structure` and `supported data formats`.\n\n### Alternative 1 - By application.properties\n\nAdd the main description by adding an `application.poperties` file to the root of your project:\n\nGenerate the uuid e.g. by a tool like https://www.uuidgenerator.net/\n\n```sh\nmsb.uuid=76499d88-34cf-4836-8cc1-7e0d9c54dacx\nmsb.name=YourSmartObjectName\nmsb.description=YourSmartObjectDesc\nmsb.token=5e0d9c54dacx\nmsb.type=SmartObject\n```\n\nWhen initializing your msb client instance, the `application.properties` file will be loaded.\n\n```js\nvar myMsbClient = new MsbClient();\n```\n\n### Alternative 2 - By constructor\n\nIf you do not provide an application.properties file, use the constructor\nto define the basic self description.\n\n```js\nvar type = 'SmartObject';\nvar uuid = uuidv4(); // you can type in an own uuid here instead of generating it\nvar name = 'SO ' + uuid;\nvar description = 'SO Desc' + uuid;\nvar token = uuid.substring(0, 7);\nvar myMsbClient = new MsbClient(\n    type,\n    uuid,\n    name,\n    description,\n    token\n);\n```\n\n## Add Events\n\nAdd `events` to your smart object / application which can be send to MSB.\n\n### Alternative 1: Simple event creation sample (using method params):\n\n```js\nvar event_id = 'E1';\nvar event_name = 'EVENT ' + event_id;\nvar event_description = 'EVENT Description for ' + event_name;\nvar event_datatype = 'string'; // see available datatypes below\nvar event_priority = 1; // 0 (LOW), 1 (MEDIUM), 2 (HIGH)\nvar isArray = false; // just one value or array of it?\n\nmyMsbClient.addEvent(\n    event_id,\n    event_name,\n    event_description,\n    event_datatype,\n    event_priority,\n    isArray\n);\n```\n\n### Alternative 2: Complex event creation sample (using object):\n\n```js\nmyMsbClient.addEvent({\n    eventId: 'E2',\n    name: 'Event E2',\n    description: 'Description for Event E2',\n    dataFormat: {\n        dataObject: {\n            '$ref': '#/definitions/MyDevice'\n        },\n        MyDevice: {\n            type: 'object',\n            properties: {\n                deviceName: {\n                    type: 'string'\n                },\n                deviceWeight: {\n                    type: 'number', format: 'float'\n                },\n                submodules: {\n                    type: 'array',\n                    items: {\n                        '$ref': '#/definitions/MyModule'\n                    },\n                },\n            }\n        },\n        MyModule: {\n            type: 'object',\n            properties: {\n                moduleName: {\n                    type: 'string'\n                }\n            }\n        }\n    },\n    implementation: {\n        priority: 1,\n    }\n});\n```\n\nSee `app_sample.js` for more event creation examples.\n\n## Add Functions\n\nAdd `functions` and their implementations your smart object / application is able to handle.\n\n### Alternative 1: Simple function creation sample (using method params):\n\n```js\nvar function_id = 'F1';\nvar function_name = 'FUNC ' + function_id;\nvar function_description = 'FUNC Description for ' + function_name;\nvar function_dataformat = 'string'; // see available dataformats below\nvar isArray = false; // handle array of values or just one value?\nvar responseEvents = []; // you can link to response events here by event_id\n\nmyMsbClient.addFunction(\n    function_id,\n    function_name,\n    function_description,\n    function_dataformat,\n    printMsg,\n    isArray,\n    responseEvents\n);\n\n// the implementation of the function (handle event message here)\nfunction printMsg(msg) {\n    console.info('PrintMsg: ' + JSON.stringify(msg));\n}\n```\n\n### Alternative 2: Complex function creation sample (using object):\n\n```js\nmyMsbClient.addFunction({\n  functionId: 'F2',\n  name: 'Function F2',\n  description: 'Description for Function F2',\n  dataFormat: {\n    dataObject: {\n      type: 'object', $ref: '#/definitions/MyCar',\n    },\n    MyCar: {\n      type: 'object',\n      properties: {\n        carColor: {\n          type: 'string'\n        },\n        carNrOfSeats: {\n          type: 'integer', format: 'int32',\n        },\n        carWeight: {\n          type: 'number', format: 'float',\n        },\n      },\n    },\n  },\n  responseEvents: [],\n  implementation: function(msg) {\n    console.info('F1 has been called, message:' + msg.dataObject);\n  },\n});\n```\n\nSee `app_sample.js` of the application template for more (and complex) examples.\n\n## Connect and Register Client\n\n```js\nvar msb_url = 'ws://127.0.0.1:8085';\nmyMsbClient.connect(msb_url);\nmyMsbClient.register();\n```\n\nYou will get an `IO_CONNECTED` and `IO_REGISTERED` event from MSB, if successful.\n\n## Event publishing\n\nFor publishing an event to a websocket broker interface,\nonly the `eventId` and `data` are required of the already specified event (see above).\n\n```js\nvar event_id = 'E1';\nvar event_value = 'Hello World!';\n\nmyMsbClient.publish(\n    event_id,\n    event_value\n);\n```\n\nThe MSB responds with an `IO_PUBLISHED` event, if successful.\n\nBy default events are published with a low priority.\n\nIt is also possible to `set the priority` of an event.\n\nThere are three possible priorities for events like it is shown at the following table.\n\n| `Constant` | `Value` |\n|:---:|:---:|\n| LOW | 0 |\n| MEDIUM| 1 |\n| HIGH| 2 |\n\n```js\nvar event_id = 'E1';\nvar event_value = 'Hello World!';\nvar event_priority = 2;\n\nmyMsbClient.publish(\n    event_id,\n    event_value,\n    event_priority\n);\n```\n\nAnother option is to publish an event as cached event by setting the cache parameter to true.\n\nThis means that the event is not deleted if the connection is broken.\n\n```js\nvar event_id = 'E1';\nvar event_value = 'Hello World!';\nvar event_priority = 2;\nvar event_isCached = true;\n\nmyMsbClient.publish(\n    event_id,\n    event_value,\n    event_priority,\n    event_isCached\n);\n```\n\nYou can also pass a event object to the publish function in the format:\n\n```js\n{\n    eventId: 'eventId',\n    value: 'value',\n    priority: 1,\n    cached: true,\n    postDate: new Date().toISOString(),\n    correlationId: correlationId\n}\n```\n\nAs mentioned above, only eventId and value are required fields\n\n```js\nvar event_id = 'E1';\nvar event_value = 'Hello World!';\nvar event_priority = 2;\nvar event_isCached = true;\nvar event_correlationId = '72047f33-a9ae-4aa5-b7ae-c1c4a2797cac';\n\nmyMsbClient.publish({\n    eventId: event_id,\n    value: event_value,\n    priority: event_priority,\n    cahced: event_isCached,\n    postDate: new Date().toISOString(),\n    correlationId: event_correlationId\n});\n```\nFor values based on complex data formats it will look like this:\n```js\nvar event_id = 'E2';\nvar event_priority = 2;\nvar event_isCached = true;\nvar event_correlationId = '72047f33-a9ae-4aa5-b7ae-c1c4a2797cac';\n\nmyMsbClient.publish({\n    eventId: event_id,\n    value: {\n      deviceName: 'Dev001',\n      deviceWeight: 62.22,\n      submodules: [\n        {moduleName: 'Module 1'},\n        {moduleName: 'Module 2'},\n      ],\n    },\n    priority: event_priority,\n    cahced: event_isCached,\n    postDate: new Date().toISOString(),\n    correlationId: event_correlationId\n});\n```\n\n## Function call handling\n\nAs shown above the addFunction method includes a `function pointer`\nto point to the function implementation.\n\n## Configuration parameters\n\nConfiguration parameters are a simple list of key value pairs for the smart object / application.\nIt is displayed and can be customized in the MSB UI to change your apps behaviour during runtime.\n\n`Add` condifuration parameters:\n\n```js\nvar param_name_1 = 'testParam1';\nvar param_value_1 = true;\nvar param_datatype_1 = 'boolean';\nmyMsbClient.addConfigParameter(param_name_1, param_value_1, param_datatype_1);\n\nvar param_name_2 = 'testParam2';\nvar param_value_2 = 'StringValue';\nvar param_datatype_2 = 'string';\nmyMsbClient.addConfigParameter(param_name_2, param_value_2, param_datatype_2);\n\nvar param_name_3 = 'testParam3';\nvar param_value_3 = 1000;\nvar param_datatype_3 = 'int32';\nmyMsbClient.addConfigParameter(param_name_3, param_value_3, param_datatype_3);\n```\n\n`Get` configuration parameter (after changed in MSB UI) to change your app behaviour:\n\n```js\n// get by getConfigParameter using name as key\nvar parameterValueFound_1 = myMsbClient.getConfigParameter(param_name_1);\nvar parameterValueFound_2 = myMsbClient.getConfigParameter(param_name_2);\nvar parameterValueFound_3 = myMsbClient.getConfigParameter(param_name_3);\n```\n\n## SSL/TLS connection configuration\n\nTo enable `SSL/TLS`, you need to specify wss:// or https:// in the URL instead of ws:// or http://.\n\nFurthermore, it is necessary to specify a trust store in the client,\nwhich contains the public certificate of the MSB interface, so that it is considered trustworthy.\n\n```js\nvar msb_url = 'wss://\u003chostname\u003e:\u003cport\u003e';\nmyMsbClient.connect(msb_url);\nmyMsbClient.register();\n```\n\nIf you use an IP instead of a public url during development,\nit will be necessary to disable the hostname verification to connect via web socket secure.\n\n```js\nmyMsbClient.disableHostnameVerification(true);\n```\n\n## Connection recovery\n\nIf connection to the common websocket interface is broken the client performs a reconnect.\n\nAfter a reconnect the registration at the MSB will be redone automatically by the client.\n\nYou can also change this intervally by setting an integer value in `ms` for the reconnect interval.\n\n```js\nmyMsbClient.setReconnectInterval(10000);\n```\n\nOr you can disable the automatic reconnect.\n\n```js\nmyMsbClient.disableAutoReconnect(true);\n```\n\n## Event caching\n\nIf the client loses the connection, the published events are cached in a queue.\n\nAfter a successfull reconnection, the queued events are published to MSB (FIFO principle).\nThe default size of the queue is 1000 entries. The size can be changed:\n\n```js\nmyMsbClient.setEventCacheSize(1000);\n```\n\nIf no event caching is needed, you can disable it.\n\n```js\nmyMsbClient.disableEventCache(true);\n```\n\n## Debug mode\n\nTo debug your clients communication with MSB, you can enable the debug mode\n\n```js\nmyMsbClient.enableDebug(true);\n```\n\nIt mgiht be also helpful to enable data format validation, to check if an event value is valid\n\n```js\nmyMsbClient.enableDataFormatValidation(true);\n```\n\n## Help\n\n### 'undefined' error for config values from application.properties\n\nIf you get an \"undefined\" error for the config values from the application properties on Windows 7,\nchange the line endings of the application.properties file from LF (Linux) to CRLF (Windows).\n\nWindows 10 should be able to handle both.\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearch-virtualfortknox%2Fmsb-client-websocket-nodejs/lists"}