CoAP server not respecting node configuration port setting?

Hi,

i searched quite a long in the forum and the wild Internet but without success, maybe I'm just blind, but... :wink: So I registered here and this is my first post.

I have a node-red system running without any issues so far. The system contains the following components:
Ubuntu 24.04.1 on a VPS at a hosting provider.
Firewall (ufw) is configured for ports 5683/udp (v4 and v6)
npm 10.9.2
node 22.8.0
node-red 4.0.8
node-red-contrib-coap 0.8.0

I have a running CoAP server which is responding correctly to a IoT device sending requests to this server. So far so good.

By some reasons i have to change the port, the CoAP server is listening. So I changed the port in the coap server node from 5683 to 5685 and opened the port in the firewall as well (5683 still open).

If the IoT device now sends requests to port 5685, there is no response from the server. Checking with tcpdump shows, that the packet has passed the firewall but also tcpdump shows no server response. I rechecked the node configuration, 5685 is shown. I did a restart of node-red, no success. Next I reconfigured the IoT device to use the original port 5683. Now the server responded, even its port configuration still shows 5685. The same behaviour happens with any non-standard port.

The only way i found after digging deeper is changing the default UDP port (COAP_PORT) in the file .node-red/node_modules/coap/dist/lib/parameters.js to 5685.
Now the server listens on port 5685 all the time, regardless the server node configuration value.

It seems, that the server node does not use the configuration value but the default value, rergardless the port configuration. The server always uses the value set in COAP_PORT.

Is there anything I missed here or I'm doing completely wrong? Is this a kind of "undocumented known issue"?

I have to say, I am a experienced embedded C developer but not a specialist in node.js/node-red.

Thanks a lot and have a nice day,
Bernhard