简体   繁体   English

Rails散居XMPP聊天

[英]Rails diaspora XMPP chat

I have a diaspora pod. 我有一个散居的豆荚。 The issues is, when I enabled the chat and run the command ./script/server , my chat system returning an error as follow: 问题是,当我启用聊天并运行命令./script/server ,聊天系统返回如下错误:

http://localhost:3000/http-bind 404 (Not Found)

Following were my diaspora.yml config: 以下是我的diaspora.yml配置:

server: ## Section

      # Start built-in XMPP server (default=true).
      # In case you want to run your own server, you should disable it.
      enabled: false

      # Set the directory in which to look for virtual hosts TLS certificates.
      # Check documentation on how to generate or configure your existing
      # certficates correctly:
      #
      # https://wiki.diasporafoundation.org/Vines#Certificates
      certs: 'config/vines'

      # The server accepts by default only valid certificates.
      # Any connection which uses self-signed ones will be closed.
      # If you'd like to accept self-signed certificates
      # on your server, set the next option to true.
      accept_self_signed: true

      # Only edit the next option if you'd like to deny
      # your users to exchange messages between other XMPP servers.
      cross_domain_messages: false

      # Set the maximum of offline messages stored per user (default=150).
      # If it exceeds, it will start deleting old messages. You can disable
      # offline message support completely by setting the option to zero.
      max_offline_msgs: 150

      ## Client to server
      c2s: ## Section

        # Configure the address that vines should listen on.
        address: '0.0.0.0'

        # Configure the client-to-server port.
        # If your server is behind a router or firewall
        # check documentation on how to forward ports:
        #
        # https://wiki.diasporafoundation.org/Vines#Firewall_Ports
        port: 5222

        # The maximum we'd like to allow for stanza size.
        max_stanza_size: 65536

        # The max_resources_per_account attribute, limits how many
        # concurrent connections one user can have to the server.
        max_resources_per_account: 5

      ## Server to server
      s2s: ## Section

        # Configure the address that vines should listen on.
        address: '0.0.0.0'

        # Configure the server-to-server port.
        # If your server is behind a router or firewall
        # check documentation on how to forward ports:
        #
        # https://wiki.diasporafoundation.org/Vines#Firewall_Ports
        port: 5269

        # The max_stanza_size attribute should be
        # much larger than the setting for client-to-server.
        max_stanza_size: 131072

        # By default every XMPP server with a valid certificate
        # is able to communicate with your server. In case of a
        # malicious server (e.g. spam reason), you can black-list them.
        blacklist:
         - 'example.com'
         - 'malicous.net'

      ## XEP-0124 BOSH requests
      bosh: ## Section

        # If you'd like to use a proxy, you should set the proxy
        # option to true, otherwise jsxc always tries to
        # connect directly to the port specified below.
        proxy: true

        # Configure the address that vines should listen on.
        address: '0.0.0.0'

        # Configure the BOSH port.
        port: 5280

        # Configure the bind endpoint.
        bind: '/http-bind'

        # The maximum we'd like to allow for stanza size.
        max_stanza_size: 65536

        # The max_resources_per_account attribute, limits how many
        # concurrent connections one user can have to the server.
        max_resources_per_account: 5

How do I setup XMPP chat server for my diaspora pod? 我如何为散居者荚设置XMPP聊天服务器?

You dosen't suposed to use diaspora directly from port 3000. Use reverse proxy. 您不必直接从端口3000使用diaspora。请使用反向代理。

Setup your webserver to reverse proxy to relay data from /http-bind requests to tcp/5280 and all other requests to tcp/3000. 将您的网络服务器设置为反向代理,以将数据从/ http-bind请求中继到tcp / 5280,并将所有其他请求中继到tcp / 3000。

If you use apache2, this may help: https://gist.github.com/jhass/719014 (read also comments) 如果您使用apache2,这可能会有所帮助: https : //gist.github.com/jhass/719014 (另请参见注释)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM