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

4.0.4: "subs" in Unidirectional SSE not subscribing to channels? [bug] #581

Closed
BusterNeece opened this issue Nov 30, 2022 · 6 comments
Closed

Comments

@BusterNeece
Copy link

BusterNeece commented Nov 30, 2022

Centrifugo version is 4.0.4
Client library used is custom JS (EventSource) directly
Operating system is Windows 11

Hello!

I'm doing the initial legwork to implement Centrifugo into my existing application. Unlike many uses of this software, the information we're broadcasting via the software is entirely public information, and is just being distributed via this format to offer a higher-performance, more reliable way of accessing that same data. As such, we're not doing any sort of authentication on the client side or otherwise gatekeeping the endpoints.

My centrifugo configuration looks like:

{
  "allow_anonymous_connect_without_token": true,
  "api_insecure": true,
  "admin": true,
  "admin_insecure": true,
  "port": 6020,
  "internal_port": 6025,
  "websocket_disable": true,
  "uni_websocket": true,
  "uni_sse": true,
  "uni_http_stream": true,
  "namespaces": [
    {
      "name": "station",
      "history_size": 1,
      "history_ttl": "30s",
      "allow_subscribe_for_client": true,
      "allow_subscribe_for_anonymous": true,
      "allow_history_for_client": true,
      "allow_history_for_anonymous": true
    }
  ]
}

(I realize there's a lot of "insecure" stuff there, but I promise the setup is such that none of the internals are exposed out to the web in any way)

The URL I'm trying to access translates to:

https://centrifugo/connection/uni_sse?cf_connect=%7B%22subs%22%3A%7B%22station%3Aazuratest_radio%22%3A%7B%7D%7D%7D

And that cf_connect query param decodes to:

{
  "subs": {
    "station:azuratest_radio": {}
   }
}

As far as I can tell from the example code, this is completely fine, but the response I get back doesn't indicate any subscribed channels, the admin dashboard does not show any channels/subs, etc...

The connection is successful, and I do get pings back from the EventSource handler, including the initial connect response:

{"connect":{"client":"(id)","version":"4.0.4","ping":25,"session":"(id)"}}

Based on what I've seen in other expected responses, if the channel was successfully subscribed to, it should appear in that connect response, right? But it doesn't, and no data ever reaches this device, despite being able to verify that we are publishing the data correctly and it's registering in the history for those channels.

What am I missing here? Thanks anyone who can help!

@BusterNeece BusterNeece changed the title "subs" in SSE not subscribing to channels [bug] 4.0.4: "subs" in Unidirectional SSE not subscribing to channels? [bug] Nov 30, 2022
@FZambia
Copy link
Member

FZambia commented Dec 1, 2022

Hello @BusterNeece

Thanks for the detailed report, addressing this in #582 - for no-token case Centrifugo ignored processing client connection desired channels coming in subs.

@BusterNeece
Copy link
Author

@FZambia Excellent, thank you!

@BusterNeece
Copy link
Author

Confirming that this fixed it for us, and now Centrifugo is incorporated as part of our solution over at @AzuraCast. Thank you very much for your fast turnaround. Excellent work all around.

@FZambia
Copy link
Member

FZambia commented Dec 12, 2022

Planning to release v4.1.0 tomorrow with these changes.

@FZambia
Copy link
Member

FZambia commented Dec 14, 2022

Part of v4.0.5, v4.1.0 will be a later as I found some issues with it.

@BusterNeece
Copy link
Author

@FZambia Excellent, thank you, our builds are updated to use the stable release and all is well!

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