PHP stream video file using fsockopen ( .wmf ) acting as proxy

Author Message
cyf

  • Total Posts : 22
  • Scores: 0
  • Reward points : 0
  • Joined: 1/25/2007
  • Status: offline
PHP stream video file using fsockopen ( .wmf ) acting as proxy Tuesday, November 18, 2008 9:33 PM (permalink)
0
OK here goes,
 
I basically have a video stream (internal ip) that i need to proxy via a php script (which will check the user is logged in) and then i will have a main page that streams from proxy.php.
This is what i have so far:
 
proxy.php
 
 <?php
 set_time_limit(0);
 $fp = fsockopen("server.domain.co.uk", 8000, $errno, $errstr, 30);
 if (!$fp) {
     echo "$errstr ($errno)<br />\n";
 } else {
     $out = "GET /andi/news011008.wmv HTTP/1.1\r\n";
     $out .= "Host: server.domain.co.uk\r\n";
     $out .= "Connection: Close\r\n\r\n";
     
     fwrite($fp, $out);
     
     while (!feof($fp)) {
         echo fgets($fp);
     }
     
     fclose($fp);
 }
 ?> 
 

 
viewvideo.html
 <object
 classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
 <param name="FileName" value="proxy.php" />
 </object>
 


If i view the proxy page directly i can see the header information and it does appear to spit out the data to the browser but when i load it through the html page is doesnt show anythign, do i need to stream this in a different way for it to work?
Any help would be great im getting quite urgent for a solution!
Thanks,
Cyf
<message edited by cyf on Tuesday, November 18, 2008 9:39 PM>
http://www.andigibson.co.uk - my blog

http://www.zero7ict.com - web hosting and development

http://www.socialaddict.co.uk - music and entertainment
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9