Closed EzPluto closed 6 years ago
Sure, you are right.
@grutabow
use libcoap to public or subscribe topic ,return 4.04
libcoap/examples/coap-client -m get -s 10 "coap://myhost:5684/mqtt/readtopic?c=client_test&u=username_test&p=secret_test"
without topic
libcoap/examples/coap-client -m get -s 10 "coap://myhost:5684/mqtt?c=client_test&u=username_test&p=secret_test"
v:1 t:CON c:GET i:736b {} [ Observe:1, Uri-Port:5684, Uri-Path:mqtt, Uri-Query:c=client_test, Uri-Query:u=username_test ]
what happened?
5684 is a secure port which requires DTLS, and not sure libcoap supports DTLS already or not. Please send data to port 5683.
my docker file
emqnode1:
image: emqttd-docker-v2.3-beta.4
hostname: emqnode1
mem_limit: 512M
container_name: emqnode1
ports:
- "1884:1883"
- "18084:18083"
- "5684:5683/udp"
emqnode2:
image: emqttd-docker-v2.3-beta.4
hostname: emqnode2
mem_limit: 512M
container_name: emqnode2
links:
- emqnode1
ports:
- "1885:1883"
- "18085:18083"
- "5685:5683/udp"
emqnode3:
image: emqttd-docker-v2.3-beta.4
hostname: emqnode3
mem_limit: 512M
container_name: emqnode3
links:
- emqnode1
ports:
- "1886:1883"
- "18086:18083"
- "5686:5683/udp"
it`s same as 5683
@grutabow
If topic contains special characters like '/','+','#' , shoud i use urlencode to percent-encode? And what about clientId,username,password , how to handle those special characters.
Would you please post the crash and error logs which could help the 4.04 problem?
If there are special characters in topic, it should be percent-encoded as you mentioned. There should be no special characters inside clientId, username and password now. Maybe we can support it in a future version.
libcoap/coap-client is able to percent-decode special characters in clientid, username and password since it is query in a URI. It is recommended not to use special characters in clientid, username and password.
for exp,use emq-auth-http model to check the clientId,username and password just like mqtt ?