Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Detect protocol for socket.io uri to add https support #1339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stevefox
Copy link

@stevefox stevefox commented Dec 7, 2016

@lukeyeager Thanks, I've rebased this against the master branch now.

@lukeyeager
Copy link
Member

(was #1333)

@lukeyeager
Copy link
Member

I tested this and verified that it doesn't break anything for non-secure sites.

Can you send me a CLA so I can merge this?

@@ -3,7 +3,7 @@
<!-- Scripts for communicating with the SocketIO server -->
<script type="text/javascript" src="/static/js/3rdparty/socket.io-1.4.5.min.js"></script>
<script>
var socket = io.connect('http://' + document.domain + ':' + location.port + "{{namespace}}");
var socket = io.connect(location.protocol + '//' + document.domain + ':' + location.port + "{{namespace}}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we go whole hog and use location.origin? Browser support looks fine.
http://www.w3schools.com/jsref/prop_loc_origin.asp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants