Closed andthereitgoes closed 4 years ago
@andthereitgoes I think you are not using this recommendation from this library readme:
Note that ?format=protobuf is required because this library only works with Protobuf protocol.
So Centrifugo thinks client is using JSON protocol while dart client actually uses binary data. Try to add ?format=protobuf
to connection url.
Aah thanks. Let me try it and get back to you.
Please reopen in case it does not help, but I am pretty sure that's the case since I reproduced error message locally.
Hello @FZambia
yes, tried it and connect/disconnect works. But I have another problem for which I couldn't find anything in the code.
After connecting I am trying to subscribe to a private channel such as $5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601
When I send the subscribe, on the server I am seeing the following in the log
{"level":"info","client":"436bb802-c9a3-471c-99d1-36b94cdf32c3","command":"id:2 method:SUBSCRIBE params:\"\\nJ$5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601\\022\\000\" ","error":"103: permission denied","reply":"id:2 error:<code:103 message:\"permission denied\" > ","user":"5daa0238-7f0c-11ea-b112-eae5569f8601","time":"2020-05-21T15:41:11Z","message":"client command error"}
\\nJ$5daa0238-7f0c-11ea-b112-eae5569f8601#5daa0238-7f0c-11ea-b112-eae5569f8601\\022\\000\
I am sure this is related to protobuf format, but not sure what to do.
I read in the readme that subscribe to private channels with JWT
is supported. So not sure what I am missing.
I am using connecting using a secret token to connect to the sever, but on the server, I am getting the following error
The following
\ufffd\u0001\b\u0001\u0010\u0000\u001a\ufffd\u0001\n\ufffd\u0001
is being added to the tokeneyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJUZXN0IE9yZ2FuaXNhdGlvbiAxIiwic3ViIjoiNWRhYTAyMzgtN2YwYy0xMWVhLWIxMTItZWFlNTU2OWY4NjAxIiwiZXhwIjoxNTg5OTg3NjYxfQ.fwwM8-L4mqdpK2kFteoYmb6TDfoQ3J0oxiyfCmbIDlY
This same token works fine for other centrifuge (js, golang, java) clients for the same server.
I have used the example code https://github.com/centrifugal/centrifuge-dart/blob/master/example/console/simple.dart