From 4d486bb1eeb4b7a568fd7a83b54f8b9232fbb82a Mon Sep 17 00:00:00 2001 From: ingjieye Date: Wed, 14 Aug 2019 10:48:12 +0800 Subject: [PATCH] Add auth function for subscriber --- include/redox/subscriber.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/redox/subscriber.hpp b/include/redox/subscriber.hpp index 63a89f4..15ab6bb 100644 --- a/include/redox/subscriber.hpp +++ b/include/redox/subscriber.hpp @@ -58,6 +58,14 @@ class Subscriber { return rdx_.connectUnix(path, connection_callback); } + /** + * Send auth message to server. + * Call this before any subscribe happens + */ + bool auth(const std::string &password) { + return rdx_.commandSync({"AUTH", password}); + } + /** * Same as .stop() on a Redox instance. */