Jump to content

Creating a simple web server?


Recommended Posts

So here's what I'm trying to accomplish:

I need the ability to restart an application on my desktop PC from within my home network. Obviously, writing a script to do that locally would take all of ten seconds. The trick is that I want to do it remotely. I still feel like it wouldn't be difficult to accomplish with a server/client script.

But of course, that's not good enough. I want to do it from my iPhone. And the easiest way I can see to accomplish that would be through the browser.

So in my mind, I'm thinking that, on the server side, I can listen for connections on, let's say port 8080. I can watch for a "GET / HTTP/1.1" (or whatever it is...) and respond with a simple webpage that reports a status and has a reset button.

On my phone, I type, say 192.168.1.150:8080 and get that simple page. When I click the reset button, it sends a "GET /?reset=true" or something and that will trigger a function in the server script to reset the app.

So in essence, this would be a very simple web server, one that only serves a single, hardcoded page. But this seems too simple. Is it? Or is it actually way more complicated than that?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...