Using non-standard port.
Posted: Mon Jan 16, 2006 4:55 am
Debian/Mepis
Linux 2.4.22 Kernel
Pentium IV 2.6
786M ram
ZM 1.21.2
4 Cameras on a single bttv chip card
ffmpeg version 0.4.8
I have 2 web servers behind a firewall. One is running ZM, the other is not. The firewall listens on port 40 for traffic to ZM and forwards it to port 80 on the ZM server. Traffic hitting the firewall on port 80 is forwarded to port 80 on the non-ZM server.
http://xxx.xxx.xxx.xxx:40 forwarded to 192.168.0.101:80 on ZM web server.
http://xxx.xxx.xxx.xxx forwarded to 192.168.0.102:80 on non-ZM web server.
All the ZM functions worked. I could get the console, call up the events window etc, but I could not get any streaming video. When I tried to watch an event, I got the correct window but with a broken image icon.The url for the broken window showed as
http://xxx.xxx.xxx.xxx/cgi-bin/zmsmode= ... 1137384199. (The port number :40 is missing from url.)
I traced back to the function getStreamSrc in zm_funcs.php, where the url for the image is built. It showed:
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
This parses to just as I have shown, the external IP address, without the port number.
My fix was to change the function slightly:
$parsedurl = parse_url( $_SERVER['HTTP_REFERER'] );
$stream_src="http://".$_SERVER['HTTP_HOST'].":".$parsedurl['port'].ZM_PATH_ZMS;
This may also apply to zm 1.22.x. It looks like the url is built in a similar fashion.
I don't know if this is due to thttpd, my particular setup, or is an actual bug.
thanks
tommy
Linux 2.4.22 Kernel
Pentium IV 2.6
786M ram
ZM 1.21.2
4 Cameras on a single bttv chip card
ffmpeg version 0.4.8
I have 2 web servers behind a firewall. One is running ZM, the other is not. The firewall listens on port 40 for traffic to ZM and forwards it to port 80 on the ZM server. Traffic hitting the firewall on port 80 is forwarded to port 80 on the non-ZM server.
http://xxx.xxx.xxx.xxx:40 forwarded to 192.168.0.101:80 on ZM web server.
http://xxx.xxx.xxx.xxx forwarded to 192.168.0.102:80 on non-ZM web server.
All the ZM functions worked. I could get the console, call up the events window etc, but I could not get any streaming video. When I tried to watch an event, I got the correct window but with a broken image icon.The url for the broken window showed as
http://xxx.xxx.xxx.xxx/cgi-bin/zmsmode= ... 1137384199. (The port number :40 is missing from url.)
I traced back to the function getStreamSrc in zm_funcs.php, where the url for the image is built. It showed:
$stream_src = "http://".$_SERVER['HTTP_HOST'].ZM_PATH_ZMS;
This parses to just as I have shown, the external IP address, without the port number.
My fix was to change the function slightly:
$parsedurl = parse_url( $_SERVER['HTTP_REFERER'] );
$stream_src="http://".$_SERVER['HTTP_HOST'].":".$parsedurl['port'].ZM_PATH_ZMS;
This may also apply to zm 1.22.x. It looks like the url is built in a similar fashion.
I don't know if this is due to thttpd, my particular setup, or is an actual bug.
thanks
tommy