Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed #10

Closed
ibrahimkoujar opened this issue Nov 4, 2018 · 5 comments
Closed

Build failed #10

ibrahimkoujar opened this issue Nov 4, 2018 · 5 comments

Comments

@ibrahimkoujar
Copy link

Hello
I am trying to build this package and I have zero knowledge in go.
after install golang and gogcc etc.
this error appeared
go build -buildmode=c-archive go-auth.go go-auth.go:15:2: cannot find package "plugin" in any of: /usr/src/plugin (from $GOROOT) /home/ik/go/src/plugin (from $GOPATH) Makefile:2: recipe for target 'all' failed make: *** [all] Error 1

What can I do to fix this problem.

thanks..

@iegomez
Copy link
Owner

iegomez commented Nov 4, 2018

Hi! What OS are you running? This package allows to write custom backends using Go's plugin package (https://golang.org/pkg/plugin/), which only supports Linux and macOS.

If that's the problem (i.e., you are running Windows), then the direct "fix" is to modify go-auth.go and remove the custom plugin funcionality and then build the package. An alternative could be to run mosquitto and this package in a docker container with some Linux distro.

@ibrahimkoujar
Copy link
Author

ibrahimkoujar commented Nov 4, 2018

Thanks for your response the problem solved I was installed go in wrong way.

But there is another problem and that's why I moved from jpmens package to this one

the problem is when user try to connect to the broker its work normally but when he try subscribe to unauthorized topic the package disconnecting the user socket from broker, its happened only with subscribe.

screenshot from 2018-11-04 03-14-14

Backend log

screenshot from 2018-11-04 03-17-14

Thanks.

@ibrahimkoujar
Copy link
Author

ibrahimkoujar commented Nov 4, 2018

mqtt client app
`var mqtt = require('mqtt');

var mqttClient = mqtt.connect('mqtt://localhost:1883', {
username: "device_1",
password: "secret",
});

mqttClient.on('connect', function () {
mqttClient.subscribe("topic2");
console.log("App connected to MQTT Broker!");
});`

@iegomez
Copy link
Owner

iegomez commented Nov 5, 2018

Sorry for the delay. The behavior you are seeing is from mosquitto, not a particular plugin. Mosquitto will disconnect the client when not authorized, so you must handle reconnection at the frontend.

I'm not sure if it's intended or a bug, you'd have to check mosquitto docs and then file an issue if it's a mistake.

@iegomez
Copy link
Owner

iegomez commented Nov 8, 2018

I see that indeed it was a problem at mosquitto as per this issue: eclipse/mosquitto#1016.
I'll close this issue now as it's not related to the plugin and it was fixed there.

Thanks for bringing it up and getting them to solve it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants