Closed muka closed 8 years ago
Sorry, self closing as it is not a bug.
The final code which works is
var server = new mosca.Server(cfg);
server.authenticate = authenticate;
server.authorizePublish = authorizePublish;
server.authorizeSubscribe = authorizeSubscribe;
server.attachHttpServer(httpserver);
Hi, I have an embed mosca instance attached with
attachHttpServer
to the mainhttp
server.I noticed that when client connect from plain mqtt the are checked via
authenticate
andauthorizeSubscribe
while instead over WS I do not see any check on connection and publish/subscribe seems to be not working (but I see subscription in mosca logs).Is it supposed to work like this or is it a bug?
UPDATE: Seems attach server must be called after overriding auth-related callbacks, but setting it after
ready
cause connection drops withConnection closed before receiving a handshake response
Thank you Luca