Make health check route configurable
authorShane Perry <shane.perry@vivint.com>
Mon, 12 Aug 2019 13:59:57 +0000 (07:59 -0600)
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>
Mon, 12 Aug 2019 17:58:30 +0000 (17:58 +0000)
webrtc/signalling/simple-server.py

index 3cb3ce2..b337eae 100755 (executable)
@@ -25,6 +25,7 @@ parser.add_argument('--port', default=8443, type=int, help='Port to listen on')
 parser.add_argument('--keepalive-timeout', dest='keepalive_timeout', default=30, type=int, help='Timeout for keepalive (in seconds)')
 parser.add_argument('--cert-path', default=os.path.dirname(__file__))
 parser.add_argument('--disable-ssl', default=False, help='Disable ssl', action='store_true')
+parser.add_argument('--health', default='/health', help='Health check route')
 
 options = parser.parse_args(sys.argv[1:])
 
@@ -48,7 +49,7 @@ rooms = dict()
 ############### Helper functions ###############
 
 async def health_check(path, request_headers):
-    if path == "/health/":
+    if path == options.health:
         return http.HTTPStatus.OK, [], b"OK\n"
 
 async def recv_msg_ping(ws, raddr):