Skip to content

Commit

Permalink
add workaround for #299
Browse files Browse the repository at this point in the history
  • Loading branch information
withstu committed Jan 14, 2024
1 parent a59fbbe commit 060ba4e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -144,6 +144,9 @@ Alternative you can use the script from Uhula: https://forum.iobroker.net/post/4
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**
* (withstu) add workaround for node 19+ ECONNRESET bug #299

### 2.2.0 (2024-01-06)
* (withstu) update dependencies
* (withstu) add admin 5 UI support
Expand Down
4 changes: 4 additions & 0 deletions lib/heos-upnp.js
Expand Up @@ -6,6 +6,7 @@
'use strict';

const { URL } = require('url');
const http = require('http');
const axios = require('axios');
const {decode} = require('html-entities');
const keyInObject = require('./tools').keyInObject;
Expand All @@ -27,6 +28,7 @@ class HeosUPnP {
async init() {
this.logSilly('[init] Get UPNP details: ' + this.url);
const response = await axios({
httpAgent: new http.Agent({ keepAlive: false }),
method: 'get',
url: this.url,
timeout: 30000
Expand Down Expand Up @@ -79,6 +81,7 @@ class HeosUPnP {
if(!this.hasService(id)){
this.logSilly('[parseServices] Get Service: ' + service.SCPDURL);
const response = await axios({
httpAgent: new http.Agent({ keepAlive: false }),
method: 'get',
url: service.SCPDURL,
timeout: 30000
Expand Down Expand Up @@ -191,6 +194,7 @@ class HeosUPnP {

this.logSilly('[sendCommand] Send command: ' + service.controlURL);
const response = await axios({
httpAgent: new http.Agent({ keepAlive: false }),
method: 'post',
url: service.controlURL,
headers: {
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@iobroker/adapter-core": "^3.0.4",
"fast-xml-parser": "^4.2.7",
"axios": "^1.6.3",
"axios": "^1.6.5",
"html-entities": "^2.3.3",
"node-ssdp": "^4.0.1",
"node-vibrant": "^3.1.6"
Expand Down

0 comments on commit 060ba4e

Please sign in to comment.