Skip to content

Commit

Permalink
updated comparer monule for connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
olton committed Nov 6, 2021
1 parent 8a8e6dc commit 4e48b9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions server/SERVER-DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,19 @@ where
**Comparison with others nodes**
Begin from version 2.0.2, you can enable comparison node height with an others nodes. For this feature, I added a parameter `comparison`.
This parameter has an array type, and must contain objects with nodes descriptions:

```json
{
"comparison": [
{
"name": "server1",
"address": "1.1.1.1:8000"
"address": "1.1.1.1:8000",
"https": false
},
{
"name": "server2",
"address": "2.2.2.2:8000"
"address": "2.2.2.2:8000",
"https": true
}
]
}
Expand Down
3 changes: 2 additions & 1 deletion server/modules/comparer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const openHostConnection = (node) => {
* https
* }
* */
const {name, address, https} = node
const {name, address, https = false} = node
const proto = https ? 'wss://' : 'ws://'

try {
Expand All @@ -91,6 +91,7 @@ const openHostConnection = (node) => {
}

client.onerror = e => {
logging(`Error connection to comparable node ${node.name} with message ${e.message}`)
}
} catch (e) {
logging(e.message)
Expand Down

0 comments on commit 4e48b9b

Please sign in to comment.