shery6405
shery6405

Reputation: 145

Authenticating with mosquittopp

I am writing a simple mqtt client which will connect with a mosquitto broker.

I have used the C++ wrapper (mosquittopp) of the mosquitto library to write the mqtt client. However, I don't know how to authenticate a client with username and password through functions provided by the mosquittopp wrapper while connecting.

I am looking for the implementation of following client-tool command with the help of mosquittopp.

mosquitto_pub -m "testing" -t test -u sheheryar -P coke

Upvotes: 1

Views: 758

Answers (1)

Bertl Rockersau
Bertl Rockersau

Reputation: 21

You can set user and password before connecting with

mosquittopp::username_pw_set(sUser, sPassword);

Upvotes: 2

Related Questions