PDA

View Full Version : Possible to send an eventstring from browser through plugin?



worldrave
January 24th, 2003, 12:41 AM
I searched for any help in mesage boards, so forgive me if this has been asked already. I know through the HTTPd plugin, which is a very basic web server program and which can see a click.
The question is, that didn't work quite well with my cellphone. But since i found a great cheap webserver program that works perfectly now with my phone. Question now is, are there any plugins i could use to tie in together if i'm running a webserver on my computer that, if received, could trigger a certain eventstring? Something that wouldn't have to have a separate program to run on the device visiting the site (obviously couldn't be run on a phone). Recap of things again i'm doing;

1.) Running Girder
2.) Running Webserver on same computer, using basic webpage I made with a few eventstrings as selections.
3.) Would want to be able to trigger an eventstring(/selections) from another computer(/cellphone) using IE or java based app.
4.) Could redesign Webpage to comply with anything that would be needed to allow this to work.

Any help is much appreciated.

Thanx for any help on this topic.

Ron
January 24th, 2003, 12:44 AM
Sure, use CGI to trigger event.exe. Or from java use the internet event server protocol...

worldrave
January 24th, 2003, 12:48 AM
How would I use CGI to trigger event.exe? (as a sample html string to look at if possible.)

Or, the other mentioned way about the internet event server protocol?

The CGI sounds a little easier method to me actually since i know nothing about Java. Yet at least.

Ron
January 24th, 2003, 01:14 AM
Best thing to do is learn a little about CGI, it's easy and there is lots of info available about it, possibly in the docs of your webserver. It basically allows you to execute program on the server.

worldrave
January 24th, 2003, 01:17 AM
Thanx again. That's what i need to do then. Hopefully CGI isn't too hard to do something like this. Thanx Ron.

Ron
January 24th, 2003, 01:41 AM
CGI is really easy. Check you server first if it supports it though.

worldrave
January 24th, 2003, 07:58 AM
What CGI programs and languages are supported?
KF Web Server supports the standard CGI/1.1 interface.
This means it works well with most CGI enable languages and we are constantly looking to improve our support for different languages.
The following list have all been tested with KF Web Server

PHP
PERL
Python
ASP

--------------------------------------------------------------------------------

What are the security restrictions on the CGI interface?
CGI enables programs to be run every time a user access a page. This enables you to make dynamic web sites which may use a database.
CGI has been the source of most security weaknesses in web servers over the recent years, as it can potentially let a malicious user run any program on your machine. For example, the Nimda Worm uses the following request to examine the system files on you hard disk.
/scripts/..%255c../winnt/system32/cmd.exe?/c+dir

For this reason KF Web Server never allows executables to be run in this way.
CGI is enabled only through the setting up of special CGI Filters. These filters call only configured CGI programs and pass them script files to execute, only after checking the security permission of the script file.

That's a go then for support for CGI then right? Also, i did a Google search for 'executing programs using CGI' but couldn't really find any helpfull info or examples. Any better ideas or sites to help. I don't mind learning this if thats what it takes. Just need a little boost in the right direction. Maybe I might be able to help out another fellow user using what i've learned. Thanks Ron :-)

Ron
January 24th, 2003, 10:04 AM
Simply put some executable file in the CGI dir and then point your browser to that file. ( something like http://something.com/cgi-bin/bla.exe )

jfath
January 25th, 2003, 04:05 PM
I just finished a little CGI interface for Girder which uses the
gireventlib DLL. You drop the .exe in your cgi-bin directory
and call it with a line like:
href="cgi-bin/girdcgi.exe?cmd0=girdev&event0=Player.Prev&dev0=18&link=_here"

Which basically says call girdcgi.exe and ask to send a girder
event called Player.Prev. You can also send payloads using
pld10=xxx&pld20=yyy&pld30=zzz
and you can send multiple commands by changing the trailing
'0' at the end of each var to [1..9].

The link=_here at the end of the line tells the Web server to
re-display the previous HTML page after execution. Good
if you have a button panel or some such. You can also send
another address in the link var.

I plan on documenting this and posting it soon, but I can email it
to any willing tester now.

Update: Download the current version from http://www.fath.us

Jerry

MR
January 30th, 2003, 12:03 PM
THis is great! I am looking for a way to control Girder from a PDA on a wireless LAN, and this might be the best way to do it.

Jerry, I wonder if you have had time to finish documentation. Also, is it possible for CGI interface you are working on to get data from Girder as well and send it? It would be great to have a web page that could display the song playing on winamp, or cover art of the currently playing DVD.

Guess I'll have to start reading how to use CGI. (Is there a free CGI server for Windows?)

HTanks,
MR

jfath
January 30th, 2003, 04:08 PM
MR

There is a readme that gives enough info for setup and use.
worldrave has been kind enough to test early versions and
we are both running succesfully using the free Xitami web
server (highly recommended).

Drop me an email at the address in my forum profile and I'll
email you a .ZIP

I'm not a CGI expert by a long shot, but here's what I know...

CGI's method of communicating back to a browser is by
returning an HTML page for display. This is often not what
I want. I'm using a set of web pages that contain images
of button pads and an image map. When I click on one
of those buttons, I send a command to Girder via my
GirdCGI app. BUT, I don't want to replace my button images
with a returned page. Two things can be done. Use the
link=_here tag when calling GirdCGI. This will return the
current page. Not perfect though, because the button pad
image blinks. The other method is to create pages that use
forms and use the target=framename construct in your HTML
to direct the returned page to another frame. In this
case you can keep a blnk html page in your webpages
directory and use link=()blank.htm in the GirdCGI to send
the blank return page to an unused frame.

So...
To return useful info, the dynamic content needs to be built
by GirdCGI or some other app and referenced in the link=
portion of the call to GirdCGI. I use the WhatsPlaying WinAmp
plugin to dynamically generate the current WinAmp info
and display that info in a frame using target=infoframe
and link=whatsplaying.htm in GirdCGI calls like play,
next,previous.

I hope to add more content return capability, but it's really
a matter of learning lua scripting so I can have Girder
generate the content referenced in the link= portion of
the GirdCGI call.

Jerry

mihooper
January 31st, 2003, 09:34 AM
MR

I am looking for a way to control Girder from a PDA on a wireless LAN
You need to check out NetRemote (http://www.netremote.org/). This program is GREAT for your application. Lot's of activity here
http://www.avsforum.com/avs-vb/showthread.php?s=&postid=1816762#post1816762

jfath
January 31st, 2003, 09:56 AM
I second the NetRemote recommendation. I've used it
for several months and it's great. If you're always
controlling from a PocketPC or Win32, Netremote
is undoubtedly easier than coding your own pages
and running a web server.

worldrave
January 31st, 2003, 07:59 PM
That's a neat other recommendation, but for people that don't care into getting the .ccf file (pronto remote file for those new to that) or will be wanting to access it from the 'net,or in my case even, my sanyo 5300 (color screen w/built in dig. camera and bigger screen) to control stuff from my phone, this IS the only way so far. With his newest version, it is close to perfect already. Only thing left to do pretty much is to get information sent back through the program. IE-songtitle in winamp as 1 example.

Why control through browser? He's a major thing for me. I DJ live on the net broadcasting using Shoutcast, and sometimes playback recorded sessions i've done. If i'm not home, i just access a mini page I made with a screenshot of Winamp and mapped hyperlinks (power on/off,play,next song,pause,stop,track back,etc.) so I can load winamp and start playing my Shoutcast stream from my phone, as well as control to a different track, all from my phone.

Or another thing i like using, being able to turn on my computer's capture program(through hardware video in), turn to a selected channel (another minipage set up already.), and start recording, and stop recording. Never miss an important program again!!

Many different examples i could give. These are just a few. I give prop's to him for making this. It's very usefull and appreciative for his work done.

MR
February 1st, 2003, 06:27 PM
I would love to use a program like Netremote, but I have a Sony Clie which is a PalmOS5 device. My understanding is that Netremote is only for Microsoft based PDAs.
-MR

mihooper
February 2nd, 2003, 08:50 AM
MR..yes you are correct. NetRemote is not compatible with Palm based devices..sorry.

debennett2
March 23rd, 2004, 09:08 PM
jfath,
I keep getting this:

The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

when I try to run this in my XP machine (IIS 5.1). I have scripts and executables enabled on the server. Any ideas what might be cause this? Any help would be GREATLY appreciated. Thanks!

jfath
March 24th, 2004, 04:21 AM
Sorry, I run Apache and haven't seen the problem. Is there a
list of headers not returned following the error line in your
post, or is that really the entire error?

Have you successfully executed other CGI apps within this
environment, or are you setting this up for the first time?

We're a little off-topic in this thread - you might want to
PM me.

jfath