Merge pull request #1282 from bohlian/develop
Enable secure socket connection when using HTTPS
This commit is contained in:
commit
de36f549e5
1 changed files with 7 additions and 1 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue