views:

144

answers:

2

Hi guys, sorry in the past I have not been able to formulate my question coherently. This will be my last try. =|

Basically, I want to do something like this website is doing: http://www.ninjavideo.net/video/56388. They are rendering an iframe that points to a port on localhost. You will see nothing in the iframe if you dont have their applet running (which can be found here: ninjavideo.net/applet.php ). I want to write a script that does something like what applet.php is doing, but I don't think they are using only php code as it won't run on computers that don't have php installed. Do you suppose they are using Java/C to do this?

Thanks for all your suggestions.

A: 

You could do this in PHP using a ready-to-run Apache setup (there are some that are ready to run from a USB key, should be possible to make into something that a client can install, but is complicated, see e.g. this tutorial) or a product like NuSphere Dock:

PhpDock is a deployment platform for PHP applications.

PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.

PhpDock combines NuSphere's powerful embeded Srv webserver and browser components.

I would usually say that if you are looking to build a Windows application, you should go with a tool that is aimed at just that, i.e. C++, C#, Java, the .NET platform, Delphi, and the likes. But if you need some kind of daemon or local web server, you may actually be well off with a product bringing a web server to the desktop.

Pekka
OMG unicorns...
BalusC
Thanks for your detailed answer. I will look into PhpDock for sure. But what do you mean by, "bringing a web server to the desktop"?
ninja123
I mean, taking web server software like Apache / PHP and running it on a client's computer. It's possible as I said, but horribly messy. Check out phpdock, I don't know the specific product but I've been very happy with their PHP IDE for years.
Pekka
@BalusC: Oh yeah, they're great! Go get yours: http://meta.stackoverflow.com/questions/37328/oh-my-godits-full-of-unicorns
Pekka
+2  A: 

An Applet is basically a piece of Java code which is served by a webpage and is supposed to run at the client machine. You can learn more about Applets at Sun's own Applet tutorial. If you're green to Java as well, then I recommend to go through Trials Covering the Basics first. Opening sockets (ports) using Java code is covered here.

That PHP script is just serving the applet code from the server, so that the client can download it.

BalusC
Just like I suspected... I'll dive into the tutorial right now! Thanks
ninja123
Good luck. Don't forget to sign the applet as well. You're by default not allowed to open sockets from inside an applet due to security reasons.
BalusC
oh yeah. It's not what your thinking... Im no hacker just a noob. hehe. Thanks
ninja123
You **need** to open a socket (port) whenever you want to achieve the same :)
BalusC
[b]Stop[/b] giving me ideas =D
ninja123