coapjs / node-coap

CoAP - Node.js style
MIT License
533 stars 156 forks source link

Why are confirmable messages being dropped in server.js? #239

Closed jghaanstra closed 3 years ago

jghaanstra commented 3 years ago

On line 300 in server.js all incoming messages that have a request code that does not start with 0 are dropped. This includes confirmable unicast message with a request code 2.05 (Content). Is there any good reason for this?

I want to have a server that responds to both multicast message with request code 0.30 and confirmable unicast messages with request code 2.05.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.

JKRhb commented 3 years ago

On line 300 in server.js all incoming messages that have a request code that does not start with 0 are dropped. This includes confirmable unicast message with a request code 2.05 (Content). Is there any good reason for this?

Only message codes starting with 0 are allowed in requests (see RFC 7252, section 12.1.1). Codes starting with 2, 4, or 5 indicate a response which should be the reason those messages are dropped by the server.

I want to have a server that responds to both multicast message with request code 0.30 and confirmable unicast messages with request code 2.05.

According to the RFC, the response code 2.05 should only be used by the server in a response to a GET request (which is indicated by the code 0.01, the code 0.30 actually does not exist). For more information on valid combination of message codes see section 5.8 and section 12.1 of RFC 7252.

JKRhb commented 3 years ago

I hope this issue is resolved, feel free to leave a comment if there are any more questions :)