473,385 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to write a browser app for Apache?

HaLo2FrEeEk
404 256MB
I'm trying to write an browser application that will let me control an instance of Windows Media Player running on my computer. So far I have a client application working great, but now I need to make it into a webpage that access over my network using my phone. I'm running an Apache server.

I've got a few ideas for how I could do it, but one might not work.

First, a browser app that will render as a webpage when requested. I dunno if this'll work because of being on Apache and not IIS.

Second, a console app that I can send commands to using php's exec() function.

Finally, a network listener that'll basically be it's own server, I'll be able to connect to that app on a specific port and send commands to it as url parameters. I'd wrap this in an html page.

Does anyone else have any ideas as to how I might do this, or comments on the ideas I've had so far?
Dec 12 '10 #1
5 2977
HaLo2FrEeEk
404 256MB
Well this has been helpful. Am I to understand that no one here has any clue how I might do this?
Dec 17 '10 #2
GaryTexmo
1,501 Expert 1GB
Unfortunately, it looks like that's the case. If you do get this figured out, it might be a great thing to write an insight on it so people looking for similar ideas in the future can learn something from your experiences :)

Good luck! I wish I had something to offer, but this is outside of my area of expertise.
Dec 17 '10 #3
peochei
12
You can configure your Apache to serve ASP.NET pages for you. Then you could write a web site which would have some controls on it to control your application. This would probably force you to override System.Web.UI.Page or even controls used on the page (lets say it would be Buttons). Than you would write a triggers to execute local operations to operate on the local application.

The other possibility, which surely will be more lightweight, is to create your own tiny WebServer which would provide only few buttons to enable controlling of the application. The effort here could be the same or even lower and the server-application would be more portable (no Apache required).
There is a HttpListener which simulates basic HTTP requests. Quite a lot of samples are over internet as well. See C# WebServer project.

You can also use WebServices, which are supported by .NET, if you don't want to bother playing with controls.
Dec 17 '10 #4
HaLo2FrEeEk
404 256MB
Bingo peochei, this is actually what I've started doing. I've currently got it listening on IP.All and port 7777. I can load up, in my computer's browser or my Droid connected to Wifi, 192.168.1.110:7777 (my computer's network IP) and it'll serve a page that says:

Hello Client

Your request: none

If I request 192.168.1.110:7777/something, then the page will print out:

Hello Client

Your request: something

The only problem I've run into is that the listening and client communication is handled in its own thread, and I' have exactly 0 experience with actual threads (not counting the background worker), so I'll have to figure out how to send information back to the main thread from the client communication thread. When I do this, I can accept requests like:

Play
Pause
Next
Previous

in the URL, and act on them in the server-side program. Like you said, the advantage to this is that it's portable, so anyone can run the server and use the program on their Windows PC.
Dec 18 '10 #5
peochei
12
It's not that hard as you probably see it. You will need one additional thread to listen for requests. Some samples can be found on the internet (try searching HTTPListener, also on http://codeproject.com). There is also TCPListener class which has more clear examples and you can benefit from it as well.

The most attention is needed to be focused on the method which will be handling requests received from GetContext() of HTTPListener. It can use ThreadPool.QueueUserWorkItem to put a request into new thread.

However, at first I wouldn't go into threading but just test simple processing of HTTPListenerContext elements in the main loop.

Actually, you don't have to take care about synchronization because of simplicity of the problem, so the easiest solution could be using simple event to inform about what has changed.
Dec 19 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Rolfe | last post by:
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow these instructions verbatim and you shouldn't have any trouble. These instructions are based on...
2
by: digidalmation | last post by:
Hello all. I've been trying to get my linux server to run mod_python. It's a Mandrake 10 linux box, and apache/mod_python are installed from rpms. apache2-mod_python-2.0.48_3.1.3-1mdk...
15
by: Philippe C. Martin | last post by:
Hi, I have a python script I wish to call from various browsers (IE; Mozilla, Firefox ..) on Windows & Linux. I read that IE had the capability to embedd Python scripts, but what about the...
4
by: Rg | last post by:
Hello, I am very beginner with jscript. I have an Apache PHP enabled webserver and want to know from where users are coming from. Understand I want the last surfer's browser visited url. I...
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
4
by: Joseph | last post by:
I know about writing CGI application using Perl and Apache to refresh a static webpage that displays on the browser. But now i have an application requirement that I hope someone can help me. ...
0
by: sg makanur | last post by:
we are doing laboratory exercises in Internet Programming Lab, we are getting answers correctly when executed at shel prompt (# perl prog.pl) but if the same program executed in browser (apache), ...
12
by: David T. Ashley | last post by:
I've noticed that some scripting languages (PHP, for example) have options to control whether the script can be terminated by the user clicking STOP on their browser (or similar mechanisms). How...
22
by: V S Rawat | last post by:
(bringing the discussion here for php.general) I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b. http://localhost/ is E:\wamp\www\ I have put the first php script...
35
by: jleslie48 | last post by:
I've written a cgi program in C using the borland 5.5 free compiler, and it runs just fine on an Apache server. My only issue is if I issue some system calls the cgi suspends until the call...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.