diff --git a/package-lock.json b/package-lock.json index d582378..0fd77ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "license": "ISC", "dependencies": { "homebridge-camera-ffmpeg": "^3.1.4", - "onvif": "github:agsh/onvif" + "onvif": "github:agsh/onvif", + "undici": "^6.19.5" }, "devDependencies": { "@types/node": "^22.1.0", @@ -4081,6 +4082,15 @@ "dev": true, "license": "MIT" }, + "node_modules/undici": { + "version": "6.19.5", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.5.tgz", + "integrity": "sha512-LryC15SWzqQsREHIOUybavaIHF5IoL0dJ9aWWxL/PgT1KfqAW5225FZpDUFlt9xiDMS2/S7DOKhFWA7RLksWdg==", + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, "node_modules/undici-types": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", diff --git a/package.json b/package.json index 4cd2f97..8eedbd5 100644 --- a/package.json +++ b/package.json @@ -44,14 +44,15 @@ }, "dependencies": { "homebridge-camera-ffmpeg": "^3.1.4", - "onvif": "github:agsh/onvif" + "onvif": "github:agsh/onvif", + "undici": "^6.19.5" }, "devDependencies": { "@types/node": "^22.1.0", "@typescript-eslint/eslint-plugin": "^7.17.0", "@typescript-eslint/parser": "^7.17.0", - "eslint": "^8.57.0", "dotenv": "^16.4.5", + "eslint": "^8.57.0", "homebridge": "^1.8.4", "nodemon": "^3.1.4", "rimraf": "^6.0.1", diff --git a/src/tapoCamera.ts b/src/tapoCamera.ts index 27e09b5..2e666f1 100644 --- a/src/tapoCamera.ts +++ b/src/tapoCamera.ts @@ -12,7 +12,7 @@ import type { TAPOCameraResponseDeviceInfo, TAPOCameraSetRequest, } from "./types/tapo"; -import { Agent } from "https"; +import { Agent } from "undici"; const MAX_LOGIN_RETRIES = 3; const AES_BLOCK_SIZE = 16; @@ -50,7 +50,9 @@ export class TAPOCamera extends OnvifCamera { super(log, config); this.httpsAgent = new Agent({ - rejectUnauthorized: false, + connect: { + rejectUnauthorized: false, + }, }); this.cnonce = this.generateCnonce();