[mythtv-users] PATCH: enable mythweb streaming via .asx

Chris Petersen lists at forevermore.net
Wed Nov 8 02:40:33 UTC 2006


Rich West wrote:
> Chris Petersen wrote:
>> actually, mythweb just checks to make sure that the browser and the
>> master backend are both on an rfc1918 IP address, not "a different
>> network" since a mixture of 10.* and 192.168.* could be fine for
>> streaming across.
>>
>> FWIW, future versions of mythweb will make the myth:// stuff a clearer
>> option (which I may backport into the fixes branch to clear up much of
>> this confusion).
> 
> Well, the code we were looking at is:
> 
>     // Is either the browser xor the master in an rfc 1918 zone?
>         if 
> (preg_match('/^(?:10|192\.168|172\.(?:1[6-9]|2[0-9]|3[0-6]))\./', 
> $Master_Host)
>                 xor 
> preg_match('/^(?:10|192\.168|172\.(?:1[6-9]|2[0-9]|3[0-6]))\./', 
> $_SERVER['REMOTE_ADDR'])) {
>             return root."pl/stream/$show->chanid/$show->recstartts";
>         }
> 
>  From what I can tell, it checks to see if the master_host is on a 
> private network and if the client browser is on a private network, but 
> both of them are not on private networks (hence, the xor), it returns 
> the root."pl/stream/..." URL.
> 
> After passing through that, it would return the myth:// address...
> 
> The problem we came across is that $Master_Host is set to 127.0.0.1 (the 
> default).  That will allow for the above if statement to be true since 
> it doesn't account for localhost..

Sorry, I originally misread this.  I thought you were saying "different
network" to get the myth:// URL, not the other way around.

Either way..  if BOTH machines are in an rfc 1918 zone, and the browser
is running windows, you get the myth:// URL.  If the master is set to
localhost (which prevents myth:// from working) or one of the machines
has a public internet IP, you get the streaming link.  Generally,
setting the backend's IP to localhost isn't recommended if anything else
will ever be connecting to it (in fact, it breaks things).

In the future, I'll be replacing the video_url config stuff with a
checkbox option to enable/disable the myth:// URL, use .asx files and/or
a local file:// type override for those who mount the recordings
directory via samba.

-Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20061107/3ecdd188/attachment.pgp 


More information about the mythtv-users mailing list