Skip to content

Commit 0b8f25d

Browse files
committed
set_autho for nmqtt_sub
1 parent 03759eb commit 0b8f25d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/nmqtt_sub.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ proc nmqttSub(host="127.0.0.1", port: int=1883, ssl:bool=false, clientid="", use
2323
else:
2424
ctx.set_host(host, port, ssl)
2525

26+
if username != "" or password != "":
27+
ctx.set_auth(username, password)
28+
2629
# Set the ping interval/keep alive
2730
ctx.set_ping_interval(keepalive)
2831

0 commit comments

Comments
 (0)