Replies: 2 comments 6 replies
-
Hey, Peter, Could you please tell about your AnyCable server configuration? (Or just show startup logs). Do you use JWT auth? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yep, definitely using JWT auth. Here are the server logs: ws | Started with pid 33471...
ws | 2024-05-28 21:59:53.906 INF Starting AnyCable 1.5.1-01a996e (pid: 33892, open file limit: 245760, gomaxprocs: 10) nodeid=Hn_GI0
ws | 2024-05-28 21:59:53.906 INF JWT authentication is enabled (param: jid, enforced: false) nodeid=Hn_GI0
ws | 2024-05-28 21:59:53.906 INF Using channels router: $pubsub nodeid=Hn_GI0
ws | 2024-05-28 21:59:53.907 INF Anonymized telemetry is on. Learn more: https://docs.anycable.io/anycable-go/telemetry nodeid=Hn_GI0 context=telemetry
ws | 2024-05-28 21:59:53.908 INF Using no-op (legacy) broker nodeid=Hn_GI0
ws | 2024-05-28 21:59:53.908 INF auto-generated authorization secret from the application secret nodeid=Hn_GI0 context=broadcast provider=http
ws | 2024-05-28 21:59:53.908 INF Accept broadcast requests at http://localhost:8090/_broadcast (authorization required) nodeid=Hn_GI0 context=broadcast provider=http
ws | 2024-05-28 21:59:53.908 INF auto-generated authorization secret from the application secret nodeid=Hn_GI0 context=rpc
ws | 2024-05-28 21:59:53.908 INF RPC controller initialized: http://localhost:3000/_anycable (concurrency: 28, impl: http, enable_tls: false, proto_versions: v1) nodeid=Hn_GI0 context=rpc
ws | 2024-05-28 21:59:53.908 INF Handle WebSocket connections at http://localhost:8090/cable nodeid=Hn_GI0
ws | 2024-05-28 21:59:53.908 INF Handle health requests at http://localhost:8090/health nodeid=Hn_GI0 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This might be a bug, or it might be a fundamental misunderstanding of mine so we'll start this as a discussion.
In order to get authentication/identification to work, the common documentation is:
However, I've stuck breakpoints in both the connect method and in the
initialize
method as shown above and they never get called. I've tried with the http broadcaster and redis broadcaster and neither seem to work. I also checked the AnyCable demo app and stuck breakpoints in there and didn't see it hit. It fees like I'm missing something fundamental.In my case, I'm trying to simply use AnyCable as the backend for realtime turbostream updates. I've worked around this and gotten these updates to work by creating custom
Turbo::StreamsChannel
and explicitly passing a user id like:along with:
So, AnyCable is working with TurboStreams (with both http and redis broadcasters) but just not with the authentication/identification for ActionCable that is typically documented. I've done some digging and it seems like
AnyCable::Rails::Connection#handle_open
method is never called and spelunked further and it seemed like something with how the websocket connections are handled but at this level things are way beyond me.Beta Was this translation helpful? Give feedback.
All reactions