An auth server example for mosquito-go-auth mosquitto plugin.
- Install
mosquitto
server (v1.6.9 is working so far); git clone https://github.com/iegomez/mosquitto-go-auth.git
;cd mosquitto-go-auth
;export CGO_CFLAGS="-I/usr/local/include -fPIC"
;export CGO_LDFLAGS="-shared"
;make
;- this will generate
go-auth.so
; - give it executable permissions with
chmod +x go-auth.go
; - place it wherever you want and reference it from
mosquitto.conf
withauth_plugin /home/mauri/Documents/Programming/mosquitto/mosquitto-go-auth/go-auth.so
;
See mosquitto.conf
example.
Run with go run main.go
.
User <ŧest
, test
> can:
subscribe
totopic/sub
;publish
totopic/pub
;
User <admin
, admin
> can do any operation.