I just figured out why my streaming was mostly broken after upgrading from 1.21.0 to 1.21.3.
I've got a permanent redirect in apache for the http vhost of my zoneminder install going to https. This seems to work fine, but for some reason zoneminder creates all the streaming links with http URLs which then fail. I've adjusted apache settings so that cgi-bin is not redirected to https and things are working.
Was something changed between 1.21.0 and 1.21.3 that would account for this?
-David
http and https
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
-
- Posts: 16
- Joined: Tue Nov 30, 2004 9:53 am
- Contact:
Until the next version you can fix this by editing zm_funcs.php
and change the http:// to https://
Code: Select all
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
Or you can make it so that the script is a bit smarter and able to handle both:
This one usualy works the best.
or another way might be (and my pesonal favorite):
But this last one may give you mixed protocols
Regards,
Cordel
This one usualy works the best.
Code: Select all
if ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ) {
$PROTOCOL = 'https';
} else {
$PROTOCOL = 'http';
}
$sream_src = $PROTOCOL . '://' .$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
Code: Select all
if ( isset($_SERVER["SERVER_PROTOCOL"]))
{
list($PROTOCOL, $version) = explode('/', $_SERVER["SERVER_PROTOCOL"]);
}
$sream_src = $PROTOCOL . '://' .$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
Regards,
Cordel
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Ideally would be create a variable in zm_config.php ( Might be there but I haven't looked yet) for
Then use this variable in zm_funcs.php
Regards,
Cordel
Code: Select all
if ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ) {
$PROTOCOL = 'https';
} else {
$PROTOCOL = 'http';
}
define('ZM_URL', $PROTOCOL . '://' .$_SERVER['HTTP_HOST']);
Regards,
Cordel