-
Notifications
You must be signed in to change notification settings - Fork 6
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
howto to use sockets #2
Comments
I should follow up here the info I was missing here was: defmodule Example.Endpoint do
use Phoenix.Endpoint, otp_app: :example
socket "/websockets", Example.Gateway
# ...
end I can make a PR to include that in the readme but it might be simpler just to copy&paste that snippet :) |
I agree a better example would help a lot, this is something I will tackle as I'm done with #1. 🙂 For the record and in the meantime, I would like to reference a topic you created on the forum that might be helpful for other devs to read - specifically the marked answer as it contains a nice example. |
HI! which url is right? @Licenser |
huh? |
|
@dcy this is what Phoenix sets as your socket path. It essentially joins the string given on the That-is, if you have |
What's the diffrence between phx_raw and Custom dispatch options? |
Essentially phx_raws serves as an utility for those who don't want to both have to add an own cowboy handler nor configure the dispatch options every time a socket is added or a new project to be started. Besides, this follows Phoenix' semantics and uses its code - thus no functionality is re-implemented unnecessarily. |
@dcy sorry I don't remember, I ended up using the custom dispatch as even with phx_raws phoenix kept messing with my code so I couldn't use it. (not phx_raw's fault!) |
how did you do the dispatch to be compatible with existing Router/Endpoint in your project? can you share an example? |
Hi first of all thanks for creating this, I was quite shocked to see that WebSockets are not supported in Phoenix and relieved to find this :D
That said for those of us less versed in Phoenix it would be really awesome to add a line or two how to add this to the routes.
The text was updated successfully, but these errors were encountered: