small update

This commit is contained in:
Waldek 2021-05-21 10:15:30 +02:00 committed by GitHub
parent 7e5b6c943c
commit 9922d3dd74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1004,10 +1004,23 @@ if __name__ == '__main__':
# Connect to HBlink
reactor.connectTCP(HBLINK_IP, HBLINK_PORT, reportClientFactory())
# Create websocket server to push content to clients
# HBmonitor does not require the use of SSL as no "sensitive data" is sent to it but if you want to use SSL:
# create websocket server to push content to clients via SSL https://
# the web server apache2 should be configured with a signed certificate for example Letsencrypt
# we need install pyOpenSSL required by twisted: pip3 install pyOpenSSL
# 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
#certificate = ssl.DefaultOpenSSLContextFactory('/etc/letsencrypt/live/hbmon.dmrserver.org/privkey.pem', '/etc/letsencrypt/live/hbmon.dmrserver.org/cert.pem')
#dashboard_server = dashboardFactory('wss://*:9000')
#dashboard_server.protocol = dashboard
#reactor.listenSSL(9000, dashboard_server,certificate)
# Create websocket server to push content to clients via http:// non SSL
dashboard_server = dashboardFactory('ws://*:9000')
dashboard_server.protocol = dashboard
reactor.listenTCP(9000, dashboard_server)
reactor.run()