Merge pull request #1282 from bohlian/develop

Enable secure socket connection when using HTTPS
This commit is contained in:
Rushabh Mehta 2015-10-13 13:46:12 +05:30
commit de36f549e5

View file

@ -6,7 +6,13 @@ frappe.socket = {
return;
}
frappe.socket.socket = io.connect(frappe.socket.get_host());
//Enable secure option when using HTTPS
if (window.location.protocol == "https:") {
frappe.socket.socket = io.connect(frappe.socket.get_host(), {secure: true});
}
else if (window.location.protocol == "http:") {
frappe.socket.socket = io.connect(frappe.socket.get_host());
}
if (!frappe.socket.socket) {
console.log("Unable to connect to " + frappe.socket.get_host());