]> www.vanbest.org Git - motioneye-debian/commitdiff
localhost (127.0.0.1) simple mjpeg camera URLs are now replaced with the
authorCalin Crisan <ccrisan@gmail.com>
Wed, 10 Jun 2015 11:27:44 +0000 (14:27 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Wed, 10 Jun 2015 11:27:44 +0000 (14:27 +0300)
actual IP address

static/js/frame.js
static/js/main.js

index 86209228fd175f1f4c9ce338ad9287536757e6b2..81fa55aef4728239024b0626d6c303219f7c4b0e 100644 (file)
@@ -82,7 +82,7 @@ function refreshCameraFrame() {
     
     if (cameraFrame.proto == 'mjpeg') {
         /* no manual refresh for simple mjpeg cameras */
-        img.src = cameraFrame.url;
+        img.src = cameraFrame.url.replace('127.0.0.1', window.location.host);
         return; 
     }
     
index 015e633676b8124e4ea03875cbdfd285ed2b1a54..05f23e0b1fb7edcac24e79bd1c23c87538737f57 100644 (file)
@@ -1571,6 +1571,7 @@ function dict2CameraUi(dict) {
     
     if (dict['proto'] == 'mjpeg') {
         mjpgUrl = dict['url'];
+        mjpgUrl = mjpgUrl.replace('127.0.0.1', window.location.host);
         embedUrl = cameraUrl + 'frame/';
     }
     else {
@@ -1588,7 +1589,7 @@ function dict2CameraUi(dict) {
         if (snapshotUrl) {
             snapshotUrl = addAuthParams('GET', snapshotUrl);
         }
-        if (mjpgUrl) {
+        if (mjpgUrl && dict['proto'] != 'mjpeg') {
             mjpgUrl = addAuthParams('GET', mjpgUrl);
         }
     }
@@ -3797,7 +3798,7 @@ function refreshCameraFrames() {
         if (!this.img) {
             this.img = $(this).find('img.camera')[0];
             if (this.config['proto'] == 'mjpeg') {
-                this.img.src = this.config['url'];
+                this.img.src = this.config['url'].replace('127.0.0.1', window.location.host);
             }
         }