-
Notifications
You must be signed in to change notification settings - Fork 17
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
Broadcast a message #3
Comments
Oh nvm seems it's just the handle I se in the router, sorry :) |
Seems still not working, this is my code: router
handler
in my code I do
but nothing gets received on the websocket client browser |
Thanks for the report, @alex88! Looks like the README needs some updating :) What's your client code look like? Are there any errors displayed in your application's console? To be honest, there's a good chance the library needs updating. I haven't really messed with it for 2 years, outside of updating some deps. The tests pass, but they're definitely not comprehensive. It also looks like only 1/2 of the examples are working, with the "Topics" example being the one that isn't working. When running the "Topics" example, I'm seeing the following error which closes the open connection:
While I'm not 100% sure yet, I have an idea about what is causing this issue. I'll try to get this fixed as soon as I can. |
No worries @slogsdon, unfortunately I had to switch to Phoenix just for the websocket feature (deadlines can't wait 😞 ) On the client side I was just using |
@alex88 Looks like it was easier than I thought. There was a change in Poison's decode functionality that changed JSON keys from atoms to strings, so it was interfering with how I was trying to use that data. I've pushed a fix via 1fcec4c, but I'm currently looking to find a nice way to write some integration tests to cover this and the rest of the library. |
As a note, I had intended on shipping this library with this JavaScript helper to aid in the message format for topic support, which may or may not be of use if you end up coming back from Phoenix. At the current state, the innards of the library expects the raw message sent between the server and client to contain an |
With your current js client you mean? Because from the code seems anything would have been ok |
Yeah, anything would be valid at this current state on both the client and server with any event and/or message. I was only bringing the client library up for the thin wrapper it provides now. The endgame for this library (if it gets to that point) is to provide some conventions for both server and client message formats where the default acts as it does today. |
In the Readme under
Broadcast from elsewhere
you useWebsockets
but that's not available, what should I use?I've seen the broadcast function is in https://hexdocs.pm/web_socket/WebSocket.Events.html#content but what should
ref
be?The text was updated successfully, but these errors were encountered: