summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-08-28 10:41:16 +0300
committerDevaev Maxim <[email protected]>2018-08-28 10:41:16 +0300
commitbc24d2c19327db81e0c3f491135e2c7c1a5dd098 (patch)
treef34f64b7e2408079bb156c8bd3cd5115df1c6131
parent16345b10057adc3615fd78c0311e2a58edabbf52 (diff)
unifised urls without binding to mjpg_streamer
-rw-r--r--kvmd/configs/nginx/nginx.conf4
-rw-r--r--kvmd/web/js/stream.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/configs/nginx/nginx.conf b/kvmd/configs/nginx/nginx.conf
index 05a11bcc..e0744769 100644
--- a/kvmd/configs/nginx/nginx.conf
+++ b/kvmd/configs/nginx/nginx.conf
@@ -112,8 +112,8 @@ http {
include /etc/nginx/proxy-params.conf;
}
- location /streamer {
- rewrite /streamer/?(.*) /$1 break;
+ location ~ ^/streamer/(snapshot|stream)(?:/(.*))?$ {
+ rewrite /streamer/?(.*)(?:/(.*))?$ /?action=$1 break;
proxy_pass http://mjpg_streamer;
include /etc/nginx/proxy-params.conf;
proxy_buffering off;
diff --git a/kvmd/web/js/stream.js b/kvmd/web/js/stream.js
index 51372420..43b720df 100644
--- a/kvmd/web/js/stream.js
+++ b/kvmd/web/js/stream.js
@@ -27,7 +27,7 @@ function Stream() {
// XXX: In current implementation we don't need this event because Stream() has own state poller
var __startPoller = function() {
- var http = tools.makeRequest("GET", "/streamer/?action=snapshot", function() {
+ var http = tools.makeRequest("GET", "/streamer/snapshot", function() {
if (http.readyState === 2 || http.readyState === 4) {
var status = http.status;
http.onreadystatechange = null;
@@ -117,7 +117,7 @@ function Stream() {
__normal_size = result.size;
__applySizeFactor();
- $("stream-image").src = "/streamer/?action=stream&time=" + new Date().getTime();
+ $("stream-image").src = "/streamer/stream/" + new Date().getTime();
}
});
};