meteorhacks / cluster

Clustering solution for Meteor with load balancing and service discovery
https://meteorhacks.com/cluster-a-different-kind-of-load-balancer-for-meteor.html
MIT License
632 stars 80 forks source link

Now getting insecure WebSocket endpoint #67

Open adamgins opened 9 years ago

adamgins commented 9 years ago

Hi,

Wondering if the changes a couple of days ago could have introduced this for me. I have not changed the cluster settings for a long while and I started getting this on my test server:

I had tried using Cloudflare but stopped using that (so not sure if it's related to this and DNS changes have not fully propagated yet).

I am using meteord with nginx on AWS opsworks

Mixed Content: The page at 'https://<my domain>/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://172.31.<AWS internetl IP>:8080/cluster-ddp/4e2d65a488d5e5077c856136179743e6ddca5ab7/web/532/bel3gonh/websocket'. This request has been blocked; this endpoint must be available over WSS.T.websocket @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32T._try_next_protocol @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32T._didClose @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32o._ir.onfinish @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32a.emit @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32X.doXhr.a.onfinish @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32a.emit @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32w._start.a.xhr.onreadystatechange @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32
b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32 Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.T.websocket @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32T._try_next_protocol @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32T._didClose @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32o._ir.onfinish @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32a.emit @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32X.doXhr.a.onfinish @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32a.emit @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32w._start.a.xhr.onreadystatechange @ b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32
b570b0fd4bc634ecb0d4c6d9be8527ae6dd6d064.js:32 Mixed Content: The page at 'https://<EXTERNAL IP>/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://172.31.<AWS INTERNAL IP>:8080/cluster-ddp/4e2d65a488d5e5077c856136179743e6ddca5ab7/web/532/4lhusb7k/xhr'. This request has been blocked; the content must be served
adamgins commented 9 years ago

@arunoda I rolled back to use 1.6.4 and this error goes away. Am I meant to configure something different with the latest version or something I am doing in code or is it a bug?

ArjunRajJain commented 9 years ago

getting the same error @arunoda

arunoda commented 9 years ago

Okay. It seems like this case from a recent change. Let me check.

arunoda commented 9 years ago

This was introduced with this change: https://github.com/meteorhacks/cluster/commit/0b1fb031b3433e49157e17648a6cf7b0616e3b26

Basically, it tries to use your endpoint to generate sockJS URL. It should be the ROOT_URL but not the endpoint. I'll will do a fix now.

arunoda commented 9 years ago

Okay. I did a fix with version v1.6.8 Make sure you've https in the ROOT_URL

meonkeys commented 9 years ago

Is this fixed now?