From e655d64b18da13be1290ccd5d46438aab9eb5b45 Mon Sep 17 00:00:00 2001 From: amirhnajafiz Date: Tue, 11 Oct 2022 14:31:33 +0330 Subject: [PATCH] update: readme --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a31626f..2a84584 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

go version -version
+version
version version version @@ -76,3 +76,25 @@ client.Publish("topic", []byte("Hello")) client.Unsubscribe("topic") ``` +## Creating a server with Auth +You can create a Stallion server with username and password for Auth. +```go +package main + +import "github.com/official-stallion/stallion" + +func main() { + if err := stallion.NewServer(":9090", "root", "Pa$$word"); err != nil { + panic(err) + } +} +``` + +Now you can connect with username and password set in url. +```go +client, err := stallion.NewClient("st://root:Pa$$word@localhost:9090") +if err != nil { + panic(err) +} +``` +