diff --git a/server/model/monitor.js b/server/model/monitor.js index 8cbd8b16b..9b6e3c268 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -427,7 +427,13 @@ class Monitor extends BeanModel { } } - const agentFamily = this.forceIp ? (this.forceIp === "ipv4" ? 4 : 6) : undefined; + let agentFamily = undefined; + if (this.forceIp === "ipv4") { + agentFamily = 4; + } + if (this.forceIp === "ipv6") { + agentFamily = 6; + } const httpsAgentOptions = { maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940) diff --git a/src/lang/en.json b/src/lang/en.json index 1ca6ef105..5caf66678 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1111,5 +1111,7 @@ "Phone numbers": "Phone numbers", "Sender name": "Sender name", "smsplanetNeedToApproveName": "Needs to be approved in the client panel", - "Disable URL in Notification": "Disable URL in Notification" + "Disable URL in Notification": "Disable URL in Notification", + "Force Ip": "Force IP", + "forceIpDescription": "If not None, the monitor will enforce using either IPv4 or IPv6 for connecting to the target." } diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index a998ee374..69ad69491 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -745,6 +745,26 @@ {{ $t("acceptedStatusCodesDescription") }} + +