質問

I have a Ruby on Rails website at which I force all connections to be SSL. I need all connections from that site to use HTTPS as well. Also, Google Chrome will automatically switch to HTTPS even if I connect to another port.

This means that I cannot connect to http://www.mysite.com:8080 I have to serve the juggernaut js file over https. But that doesn't work since Juggernaut doesn't want to use https instead of http at its internal webserver. So I copied the application.js file from the juggernaut folder /usr/local/lib/node_modules/juggernaut/public/application.js into my rails folder public/juggernaut and changed the following line in my HTML code:

to

Now I seem to be able to at least initiate a Juggernaut object. The problem arises when I start to actually do some listening. I get this error:

Not found: https://www.mysite.com:8080/socket.io/1/?t=1340749304426&jsonp=0

So either I need to

a) be able to change it so I can actually have Juggernauts webserver use https instead of http. This is preferable.

or

b1) fix Juggernaut so it doesn't try to access socket.io over port 8080 and

b2) add socket.io to my server, preferably under the www.mysite.com/juggernaut folder instead of the root.

Any ideas?

Thanks!

役に立ちましたか?

解決

Might be a little late but I was able to get it to work using this. (My juggernaut is hosted on heroku)

    var jug = new Juggernaut({
        secure: true,
        host: 'yourHostHere',
        port: 443,
        transports: ['xhr-polling','jsonp-polling']
    });
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top