ryanb / private_pub

Handle pub/sub messaging through private channels in Rails using Faye.
MIT License
864 stars 228 forks source link

EOFError end of file error with publish_to under ssl #49

Closed cctalbott closed 12 years ago

cctalbott commented 12 years ago

Keep getting EOFError end of file error with publish_to when running under ssl. Acts kind of like the private_pub_token/secret_token is getting garbled somewhere when using ssl.

Returns success when running curl statement something like this: curl https://domain.com:4443/faye -d 'message={"channel":"/the/channel", "data":"hello", "ext":{"private_pub_token":"secret_token"}'

PrivatePub.publish_to("/the/channel", "hello") Fails in browser and rails console seemingly no matter what tweaks I've made to it and the server over the past couple days.

Faye is backed with thin and server is ubuntu linux with rails running on nginx + unicorn.

Here's the the lines pertaining to private_pub from the error response: from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/private_pub-1.0.1/lib/private_pub.rb:34:in publish_message from /usr/local/rvm/gems/ruby-1.9.3-p125/gems/private_pub-1.0.1/lib/private_pub.rb:28:in publish_to which are: line 34 publish_message(message(channel, data)) line 28 url = URI.parse(config[:server])

cctalbott commented 12 years ago

Got it working as advertised. Added require 'net/https' and require 'uri' to lib/private_pub. Think it's the uri require that got it going.