Skip to content

Commit ff61e57

Browse files
committed
Add option for IPv6 agent to request node
1 parent cf35e0d commit ff61e57

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

coap/coap-request.html

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
);
1212
},
1313
},
14+
useIPv6Agent: { value: false, required: true },
1415
observe: { value: false, required: true },
1516
multicast: { value: false, required: true },
1617
multicastTimeout: { value: 20000, required: false },
@@ -53,6 +54,10 @@
5354
<option value="DELETE">DELETE</option>
5455
</select>
5556
</div>
57+
<div class="form-row">
58+
<input type="checkbox" id="node-input-useIPv6Agent" style="display: inline-block; width: auto; vertical-align: top;">
59+
<label for="node-input-useIPv6Agent" style="width: auto" data-i18n="coapRequest.inputIPv6.label"></label>
60+
</div>
5661
<div class="form-row">
5762
<input type="checkbox" id="node-input-observe" style="display: inline-block; width: auto; vertical-align: top;">
5863
<label for="node-input-observe" style="width: auto" data-i18n="coapRequest.inputObserve.label"></label>

coap/coap-request.js

+4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module.exports = function (RED) {
4242
reqOpts.multicast = config.multicast;
4343
reqOpts.multicastTimeout = config.multicastTimeout;
4444

45+
if (node.options.useIPv6Agent) {
46+
reqOpts.agent = coap.globalAgentIPv6;
47+
}
48+
4549
function _onResponse(res) {
4650
function _send(payload) {
4751
node.send(

coap/locales/de/coap-request.json

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"label": "URL",
1010
"placeholder": "coap://"
1111
},
12+
"inputIPv6": {
13+
"label": "IPv6-Agent verwenden"
14+
},
1215
"inputMethod": {
1316
"label": "Methode"
1417
},

coap/locales/en-US/coap-request.json

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"label": "URL",
1010
"placeholder": "coap://"
1111
},
12+
"inputIPv6": {
13+
"label": "Use IPv6 agent"
14+
},
1215
"inputMethod": {
1316
"label": "Method"
1417
},

0 commit comments

Comments
 (0)