Page 1 of 1
Browser Control of VLM
Posted: 07 Dec 2005 13:48
by Scott JHU-ECE
Does anyone have experience (and/or thoughts and suggestions) on controlling VLM (either through the telnet or the http interface) from within a browser? I was trying to do it with PHP; which supposedly provides for a telnet connection interface, but it didn't want to connect properly. I'd imagine I could pull it off with a java applet, but I'd like to try and avoid such a cumbersome interface. Has anyone else done this?
Posted: 07 Dec 2005 17:06
by werix
Havn't do it with PHP, but the VLM control is simply a telnet with port 4212 by default, just write a script with socket or telnetlib if exist. I wrote one in python, so it should works with PHP....
Re:
Posted: 07 Dec 2005 17:18
by Scott JHU-ECE
I'm close, very close. I open the connection as follows:
$pw = 'ece';
$fp = fsockopen("128.220.81.237", 80, $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: 128.220.81.237\r\n";
$out .= "\r\n";
fputs($fp, $out);
$i = 0; // Placeholder that helps the script along.
echo fgets($fp, 128); // Pasword prompt shows up here.
echo fputs($fp, "ece"); // Send the password.
echo fgets($fp, 128); // Returns wrong password from here on out
echo fputs($fp, $pw);
echo fgets($fp, 128);
fclose($fp);
...and it does indeed bring up the Password: prompt. However, I can't get it to parse the password I send to it (see above). I've tried \r's and \n's at the end of the line and combinations thereof. fputs() gives the number of characters written if successful, and it does indeed spit back '3' at me, as expected. VLC's telnet interface doesn't seem to want to take it though. Any thoughts?
Posted: 07 Dec 2005 18:47
by werix
Hi Scott,
I don't know why you did it with port 80 and those HTTP header's code...
I did the trick by using a ethereal sniffer to "hear" all traffics between VLC server and client side, after that with Following TCP stream, you'll get all message in clair mode... so you might know what's wrong with your code... hope this helps.
cheers
Re: Browser control ofVLM from a php web site
Posted: 07 Jan 2006 13:34
by pootle
[quote="Scott JHU-ECE"]I'm close, very close. [quote]
Scott, did you get control through the telnet interface working from php?
I would like to do the same sort of thing...
control
Posted: 24 Mar 2006 17:11
by mediaguy06
I suggest trying using remote terminal with Xp maybe that would be a better choice. I also have a question am looking to use a database to stream my files. Do youhave any suggestions on how to make one I saw that you are making one so I would like to get some pointers where I can look at some code to create one. Thanks
Re:
Posted: 29 Mar 2006 13:18
by Guest
I'm close, very close. I open the connection as follows:
$pw = 'ece';
$fp = fsockopen("128.220.81.237", 80, $errno, $errstr, 10);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: 128.220.81.237\r\n";
$out .= "\r\n";
fputs($fp, $out);
$i = 0; // Placeholder that helps the script along.
echo fgets($fp, 128); // Pasword prompt shows up here.
echo fputs($fp, "ece"); // Send the password.
echo fgets($fp, 128); // Returns wrong password from here on out :-(
echo fputs($fp, $pw);
echo fgets($fp, 128);
fclose($fp);
...and it does indeed bring up the Password: prompt. However, I can't get it to parse the password I send to it (see above). I've tried \r's and \n's at the end of the line and combinations thereof. fputs() gives the number of characters written if successful, and it does indeed spit back '3' at me, as expected. VLC's telnet interface doesn't seem to want to take it though. Any thoughts?
:D