morkai/h5.coap

Failure to fetch coap://coap.me/.well-known/core

Closed this issue · 2 comments

When I try to fetch coap://coap.me/.well-known/core using h5.coap, the connection times out.

I believe this was an IPv6 DNS issue on my PC.

tl;dr Right now, the Client doesn't support domain names in URIs.

Sent requests are saved in a map, where a key includes the : (in this case: coap.me:5683). When the response comes, the domain name is not known, so it cannot match to the request and so the request times out.

Before sending a request, it should check whether the specified remote endpoint address contains a domain name or an IP address. If it's a domain, then it should be resolved to an IP address, the endpoint address should be changed to that IP and the Uri-Host option set to the domain name.