Page 1 of 1
http and https
Posted: Sat Jul 30, 2005 12:12 am
by dbosso
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
Posted: Mon Aug 01, 2005 4:55 pm
by zoneminder
I will check this. I think someone reported an issue with using WMP which failed to find the stream unless it was a full url, so I may have added that on. I'll make it configurable in the next release if it's going to cause problems.
Phil
Posted: Mon Aug 01, 2005 11:16 pm
by dbosso
Thanks. What you probalby want is a preference for a base url for zoneminder. Then you can also handle the non-standard port case.
-David
Posted: Mon Oct 24, 2005 4:01 am
by dreadlocks
Until the next version you can fix this by editing zm_funcs.php
Code: Select all
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
and change the http:// to https://
Posted: Mon Oct 24, 2005 9:19 am
by cordel
Or you can make it so that the script is a bit smarter and able to handle both:
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;
or another way might be (and my pesonal favorite):
Code: Select all
if ( isset($_SERVER["SERVER_PROTOCOL"]))
{
list($PROTOCOL, $version) = explode('/', $_SERVER["SERVER_PROTOCOL"]);
}
$sream_src = $PROTOCOL . '://' .$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
But this last one may give you mixed protocols
Regards,
Cordel
Posted: Mon Oct 31, 2005 5:43 pm
by zoneminder
Added to bug list. I'll put something in the next release.
Phil
Posted: Mon Oct 31, 2005 6:52 pm
by cordel
Ideally would be create a variable in zm_config.php ( Might be there but I haven't looked yet) for
Code: Select all
if ( isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ) {
$PROTOCOL = 'https';
} else {
$PROTOCOL = 'http';
}
define('ZM_URL', $PROTOCOL . '://' .$_SERVER['HTTP_HOST']);
Then use this variable in zm_funcs.php
Regards,
Cordel
Posted: Sat Mar 04, 2006 10:11 pm
by snei
*edit*