Juggernaut on a https website

289 views Asked by At

I'm trying to use Juggernaut 2 on a website that uses HTTPS. I don't need Juggernaut itself to use https per se.

So, I'm trying to load the required application.js from Juggernaut's own webserver at port 8080 through http in the layout of my rails app.

That works fine.

Then I notice Juggernaut trying to read socket.io from port 8080 through https, and ofcourse failing since it's own webserver uses http and not https.

So I either need to make Juggernaut's own webserver at 8080 use https or I need to get juggernaut to load everything it needs from port 8080 through http.

I could ofcourse locate its application.js and hardcode http usage in there, but is there a better way to solve this ?

2

There are 2 answers

0
lebreeze On

You could also host the socket.io and juggernaut js file on your own site and reference them that way through https.

That way your users won't have warnings about insecure content on a secure site.

The downside of course is that you will need to keep them up to date them whenever you upgrade juggernaut.

0
Roger Heykoop On

With some searching I found this solution:

<script type="text/javascript" charset="utf-8">
  var jug = new Juggernaut({protocol: 'http', host: 'www.mysite.com', port: '8080', secure: false});
</script>

This will let Juggernaut load socket.io through the host,protocol and port that you specify.