mirror of
https://github.com/ShaYmez/HBMonv2.git
synced 2025-05-23 18:02:27 -04:00
Revert "SSL and nonSSL at the same time."
This reverts commit 15a966ad5e14052d92b6ef870fd5f1c16e61dd01.
This commit is contained in:
parent
15a966ad5e
commit
aa8472994d
@ -12,13 +12,7 @@
|
|||||||
opb_table = document.getElementById('opb');
|
opb_table = document.getElementById('opb');
|
||||||
peers_table = document.getElementById('peers');
|
peers_table = document.getElementById('peers');
|
||||||
|
|
||||||
// Use both https and http protocols
|
wsuri = (((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.hostname + ":9000");
|
||||||
if (window.location.protocol != "https:") {
|
|
||||||
wsuri = "ws://" + window.location.hostname + ":9000";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
wsuri = (((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.hostname + ":9001");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("WebSocket" in window) {
|
if ("WebSocket" in window) {
|
||||||
sock = new WebSocket(wsuri);
|
sock = new WebSocket(wsuri);
|
||||||
|
10
monitor.py
10
monitor.py
@ -40,7 +40,7 @@ from subprocess import check_call, CalledProcessError
|
|||||||
# Twisted modules
|
# Twisted modules
|
||||||
from twisted.internet.protocol import ReconnectingClientFactory, Protocol
|
from twisted.internet.protocol import ReconnectingClientFactory, Protocol
|
||||||
from twisted.protocols.basic import NetstringReceiver
|
from twisted.protocols.basic import NetstringReceiver
|
||||||
from twisted.internet import reactor, task, ssl
|
from twisted.internet import reactor, task
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
@ -1012,10 +1012,10 @@ if __name__ == '__main__':
|
|||||||
# and add load ssl module in line number 43: from twisted.internet import reactor, task, ssl
|
# and add load ssl module in line number 43: from twisted.internet import reactor, task, ssl
|
||||||
#
|
#
|
||||||
# put certificate https://letsencrypt.org/ used in apache server
|
# put certificate https://letsencrypt.org/ used in apache server
|
||||||
certificate = ssl.DefaultOpenSSLContextFactory('/etc/letsencrypt/live/hbmon.dmrserver.org/privkey.pem', '/etc/letsencrypt/live/hbmon.dmrserver.org/cert.pem')
|
#certificate = ssl.DefaultOpenSSLContextFactory('/etc/letsencrypt/live/hbmon.dmrserver.org/privkey.pem', '/etc/letsencrypt/live/hbmon.dmrserver.org/cert.pem')
|
||||||
dashboard_server = dashboardFactory('wss://*:9001')
|
#dashboard_server = dashboardFactory('wss://*:9000')
|
||||||
dashboard_server.protocol = dashboard
|
#dashboard_server.protocol = dashboard
|
||||||
reactor.listenSSL(9001, dashboard_server,certificate)
|
#reactor.listenSSL(9000, dashboard_server,certificate)
|
||||||
|
|
||||||
# Create websocket server to push content to clients via http:// non SSL
|
# Create websocket server to push content to clients via http:// non SSL
|
||||||
dashboard_server = dashboardFactory('ws://*:9000')
|
dashboard_server = dashboardFactory('ws://*:9000')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user