Socket timeout change in Phoenix 1.4.9

I have been trying to change the socket timeout in Phoenix for my app. In Phoenix 1.3.4 it could be done using

transport :websocket, Phoenix.Transports.WebSocket,
  timeout: :infinity,
  serializer: [{Phoenix.Transports.WebSocketSerializer, "~> 2.0.0"}],
  transport_log: false 

configuration in the socket. But with Phoenix 1.4.9 Phoenix.Transports.Websocket has been deprecated. Is there a way I can do this in Phoenix 1.4.9?

Thanks
Sagar

:wave:

You should be able to do it in endpoint.ex.

https://hexdocs.pm/phoenix/channels.html#endpoint

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

socket "/socket", YourAppWeb.UserSocket,
  websocket: [
    timeout: :infinity,
    # ... etc
  ],
  longpoll: false
2 Likes