Вопрос

I get an EOFError end of file error. when running PrivatePub.publish_to("/dir/file", "Some Text") within a rails controller in SSL. Think it has something to do with a uri not parsing. Really have no idea though and can't some to trace anything down to point me in the right direction.

Anybody else tried running PrivatePub with SSL and run into anything like this or have a solution?

Update: Got something useful in the console maybe. ran:

res = PrivatePub.publish_to("/orders/160/status_update", "confirmed")
got: => #<Net::HTTPOK 200 OK readbody=true>

then ran:

res.body
got: => [{"channel":"/orders/160/status_update","error":"Incorrect token.","successful":false}]

Update:
get this when I run thin serve verbose:
[{"id":"g","channel":"/meta/connect","successful":false,"error":"401:3qz34hj7bsqbpr953e8rfa89b:Unknown client","advice":{"reconnect":"handshake"}}]

Update:
did some things in the nginx config and now I get this: 400 The plain HTTP request was sent to HTTPS port.

Update:
Nothing I do with the server setup solves this. Here's the errors pertaining to private_pub in the EOFError 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])

SOLVED!
Added require 'net/https' and require 'uri' to lib/private_pub.rb in my fork of the private_pub gem.

Not sure if net/https or uri or both were the ticket but I get no more EOFError and the publish_to method seems to be working as advertised now. Guess I need to requests a merge with the main branch now or inform the original gem owner and let him do as he sees fit.

Это было полезно?

Решение

Added require 'net/https' and require 'uri' to lib/private_pub.rb in my fork of the private_pub gem.

Not sure if net/https or uri or both were the ticket but I get no more EOFError and the publish_to method seems to be working as advertised now. Guess I need to requests a merge with the main branch now or inform the original gem owner and let him do as he sees fit

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top