【问题标题】:Is there any way to send data to pusher channel_auth_endpoint?有什么方法可以将数据发送到推送器 channel_auth_endpoint?
【发布时间】:2013-02-25 00:36:40
【问题描述】:

我正在开发与 pusher 的聊天,我需要向身份验证端点发送一些数据,有什么方法可以发送数据并通过 POST 或 GET 访问它?

  Pusher.channel_auth_endpoint = '/server/client_auth';
  pusher = new Pusher('public_key');

谢谢!!!

【问题讨论】:

    标签: php javascript authentication pusher


    【解决方案1】:

    是的,您可以在创建 Pusher 实例时提供要发送到身份验证端点的其他数据,例如

    var authOptions = {
      headers: {
        'header-1': 'header-value-1',
        'header-2': 'header-value-1'
      },
      params: {
        'param-1': 'param-value-1',
        'param-2': 'param-value-2'
      }
    };
    var pusher = new Pusher( APP_KEY, { auth: authOptions } );
    

    更多信息和用例示例可以在 Pusher 文档中找到: http://pusher.com/docs/client_api_guide/client_connect#options_parameter

    如果这不适合您的用例,我建议您与Pusher Support 联系,我们可能会计划一些解决方案来更好地满足您的要求。

    【讨论】:

      猜你喜欢
      • 2021-08-08
      • 2020-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多