diff options
author | Evgeny Sorokin <me@ch1p.io> | 2024-04-03 05:22:52 +0300 |
---|---|---|
committer | Evgeny Sorokin <me@ch1p.io> | 2024-04-03 05:22:52 +0300 |
commit | 9327c98e48863dabec92b15f6a1d184e7bcfddb0 (patch) | |
tree | f32efe1d2362a25dee0c0c358f94f6f1aca4b0c6 /bin/web_kbn.py | |
parent | e6e728d89b7eb06b0878fcd73dbf4ab38cfe4ec1 (diff) |
web_kbn upd
Diffstat (limited to 'bin/web_kbn.py')
-rwxr-xr-x | bin/web_kbn.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/web_kbn.py b/bin/web_kbn.py index 48af167..bfa32f6 100755 --- a/bin/web_kbn.py +++ b/bin/web_kbn.py @@ -9,6 +9,7 @@ import re import inverterd import phonenumbers import time +import os.path from io import StringIO from aiohttp import web @@ -441,9 +442,16 @@ async def cams(req: web.Request): cams = cc.get_all_cam_names() mode = {'type': 'all'} + if req.headers.get('Host').endswith('.manor.id'): + hls_pfx = 'https://'+req.headers.get('Host') + hls_pfx += re.sub(r'/home/?$', '/ipcam/', os.path.dirname(req.headers.get('X-Real-URI'))) + else: + hls_pfx = 'http://'+config.app_config['hls_local_host']+'/ipcam/' + js_config = { - 'host': config.app_config['hls_local_host'], - 'proto': 'http', + 'pfx': hls_pfx, + # 'host': config.app_config['hls_local_host'], + # 'proto': 'http', 'cams': cams, 'hlsConfig': { 'opts': { |