0

I am creating appliction which recives HTTP POST request, saves it to hash and moves to Redis and it works fine so far. Now I would like to push these datas to client IN REAL TIME. I though about using WebSocket and after generating WebSocket (rails g websocket_rails:install) meet with the first issue. I cant to post requestes anymore.

org.apache.http.conn.HttpHostConnectException: Connect to
localhost:3000 [localhost/127.0.0.1] failed: Connection refused
  • What should I do then?
  • Using WebSocket is proper way?
  • Can I first receive POST request and then create a channel to pushing datas to client?
mike927
  • 682
  • 1
  • 8
  • 25
  • Provide your source code, related to web socket. – EugZol Aug 07 '15 at 10:39
  • I change nothing so far. It generated me three files: create config/events.rb create config/initializers/websocket_rails.rb append app/assets/javascripts/application.js – mike927 Aug 07 '15 at 11:06
  • Ok, where exactly do you see that error you are seeing? Rails log? Console? – EugZol Aug 07 '15 at 11:38
  • console but now I get other issue: RuntimeError (eventmachine not initialized: evma_connect_to_server): – mike927 Aug 07 '15 at 12:35
  • I think you need to use the `thin` server in order to leverage `websockets` using the `websocket_rails`... is the thin server included in your gemfile? – Myst Aug 08 '15 at 08:33
  • ActionController::RoutingError (No route matches [GET] "/socket.io"): I get such issue when I receive post request – mike927 Aug 10 '15 at 07:34

1 Answers1

0

As pointed out before, websocket-rails isn't in active development and it's last commit was a long time ago, as you can see reading this question about alternatives and this question about issues with websocket-rails

I would recommend you replace the websocket-rails with either a websocket framework that can work together with Rails, such as Plezi, or use Faye which is a bit hardcore but very popular.

Community
  • 1
  • 1
Myst
  • 18,516
  • 2
  • 45
  • 67