Websocket endpoint without "/websocket" suffix

Hello guys !
I want to make websocket at this endpoint : ws://xxxx/cable

So, i’ve tried this in my endpoint file:

//Endpoint.ex

But when i run mix phx.routes i got this:
Capture d’écran 2021-05-10 à 15.35.15

There is a “/websocket” suffix and i don’t want it, Is it possible to delete this suffix ? I’m new on elixir.
Thx for the help :wink: Have a nice day

If it’s not clear i want this result when i run

mix phx.routes

Result wanted:

websocket WS /cable

Perhaps you can set the :websockets :path option to / instead of leaving it as its default.

https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-common-configuration

3 Likes

thx a lot !! It works ! :wink: