firehoseio / firehose

Build realtime Ruby web applications. Created by the fine folks at Poll Everywhere.
http://firehose.io/
MIT License
727 stars 72 forks source link

Running into CORS issues with a local client? #18

Closed jweissman closed 11 years ago

jweissman commented 11 years ago

I maybe missing something even bigger here, but I just wanted to report what I'm seeing out-of-the-box.

First off, I'm not able to subscribe using curl; the server throws this error:

[2013-04-08 02:15:46.703 #15658] ERROR : Use pubsub client
[2013-04-08 02:15:46.707 #15655] ERROR : reaped #<Process::Status: pid 15658 exit 1> worker=0
[2013-04-08 02:15:46.708 #15655] ERROR : Invalid argument - setrlimit
[2013-04-08 02:15:46.708 #15655] ERROR : RLIMIT_NOFILE needs to be increased to >=406  before starting firehose master server

I'm also running into trouble connecting from a browser using the JS Firehose consumer. I seem to be getting CORS-style problems talking to Firehose. I'd be fine with using websockets as the transport if I can configure that (assuming that would let me work around whatever I'm seeing.) At any rate the errors I'm getting from a browser console are of the form

XMLHttpRequest cannot load http://localhost:7474/resources/1.json. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. 

A bit weird. I'm thinking I've missed something during setup, but would welcome any thoughts/help here. Thank you!

jweissman commented 11 years ago

Note this also happens for me when using the firehose consume; the full error around this is like:

[2013-04-08 03:23:33.444 #18769] DEBUG : HTTP GET with last_sequence 0 for path /hello with query "last_message_sequence=0" and params {"last_message_sequence"=>"0"}
[2013-04-08 03:23:33.449 #18769] INFO : [em-hiredis 127.0.0.1:6379] Reconnect failed
[2013-04-08 03:23:33.449 #18769] INFO : [em-hiredis 127.0.0.1:6379] Reconnect failed
[2013-04-08 03:23:33.450 #18769] ERROR : Use pubsub client
[2013-04-08 03:23:33.454 #18731] ERROR : reaped #<Process::Status: pid 18769 exit 1> worker=0
[2013-04-08 03:23:33.455 #18731] INFO : worker=0 spawning...
[2013-04-08 03:23:33.523 #18786] INFO : Rainbows! EventMachine worker_connections=400
[2013-04-08 03:23:33.524 #18786] INFO : EventMachine: epoll=false kqueue=true

It seems like em-hiredis behavior might be implicated here?

jweissman commented 11 years ago

Assuming this is related to the recent (breaking) em-hiredis changes. Will reopen if that doesn't seem to resolve this.