Phoenix.Transports.LongPoll

Phoenix.Transports.LongPoll

Socket transport for long poll clients.

Configuration

The long poll is configurable in your socket:

transport :longpoll, Phoenix.Transports.LongPoll,
  window_ms: 10_000,
  pubsub_timeout_ms: 2_000,
  transport_log: false,
  crypto: [max_age: 1209600]
  • :window_ms - how long the client can wait for new messages in its poll request

  • :pubsub_timeout_ms - how long a request can wait for the pubsub layer to respond

  • :crypto - options for verifying and signing the token, accepted by Phoenix.Token. By default tokens are valid for 2 weeks

  • :transport_log - if the transport layer itself should log and, if so, the level

  • :check_origin - if we should check the origin of requests when the origin header is present. It defaults to true and, in such cases, it will check against the host value in YourApp.Endpoint.config(:url)[:host]. It may be set to false (not recommended) or to a list of explicitly allowed origins

  • :code_reloader - optionally override the default :code_reloader value from the socket’s endpoint

Summary

Functions

default_config()

Functions

default_config()

© 2014 Chris McCord
Licensed under the MIT License.
https://hexdocs.pm/phoenix/Phoenix.Transports.LongPoll.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部