Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants