faye ruby client is not working

后端 未结 2 598
深忆病人
深忆病人 2021-02-04 20:58

I am using faye on my Rails 2.1 app. And after testing and fixing many things faye ruby client is not working.

This is my server code.

requi         


        
2条回答
  •  一个人的身影
    2021-02-04 21:32

    I finally used HTTP not the Ruby Faye client as described in railscasts episode 260.

    require 'net/http'
        message = {:channel => '/faye/new_chats', :data => self.text, :ext => {:auth_token => FAYE_TOKEN}}
        uri = URI.parse("http://localhost:9292/faye")
        Net::HTTP.post_form(uri, :message => message.to_json)
    

    It solves my problem.

    NOTE: This solution only works with HTTP but not with HTTPS. If any one find a solution for HTTPS plz update me.

提交回复
热议问题