Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.92k stars 175 forks source link

Wrong protocol passed to socket.io #198

Closed toxik closed 12 years ago

toxik commented 12 years ago

Hi!

I have a website running securely at https://example/ and in it I included now.js that runs on the same host but on different port and on the http protocol, insecurely (I want it this way because the speed is a lot better) http://example:8080/now/now.js

The problem is that in order to fetch the socket.io client lib, there's an erroneous request made to https://example:8080/socket.io/socket.io.js

Is there any way I could fix it ?

steveWang commented 12 years ago

Manually call nowInitialize (and set opts.autoHost to false).

toxik commented 12 years ago

OK, done that seems to work but I still get a hit to the https link (before loading the correct http link described in nowInitialize). Is that normal behaviour ?

steveWang commented 12 years ago

Set autoHost to false (in the options object that you pass in to nowjs.initialize).

If you've already done that, I have no idea; sorry.

toxik commented 12 years ago

It doesn't seem to do any good with autoHost: false

It's ok the way it is now, I can live with that extra https:// request, thanks!