Re: Need http server source to look at

Tech-Archive recommends: Fix windows errors by optimizing your registry



There is a simple MFC-based sample here: "Where can I find examples of
socket programs?" at http://www.codeguru.com/forum/showthread.php?t=326666

It's pretty old, though, around the time of transition from HTTP/0.9 to
HTTP/1.0. But it's in article-format, and gives an explanation of what is
needed for a simple server, so the article's text might be more helpful to
you than its code.

Mike

"Angus" <nospam@xxxxxxxxx> wrote in message
news:OriS%23xnjHHA.5012@xxxxxxxxxxxxxxxxxxxxxxx
I have had a look at some source code and it basically looks fairly
straightforward for simply GET type output. you just get the file
requested
and spit it out to the client.

I do have another question though. The http server is for configuring my
server. So it will have buttons to do things. I want all this to be as
easy as possible. Is it best I use JavaScript on say an onclick on the
button - to eg request something from the server? My program then
responds
with some output. But that is what I am trying to get my head round. If
the button eg said CheckStatus - I would want a function which checks
something in my program to be called and then report back the results.
How
do I call this from the client? What do I need on the server end? Can my
program just check if request is x and then run an internal function and
then just output whatever is required?

I hope my explanation of what I want to do is clear. A bit like eg an
embedded http server in a router firmware.

Angus



"Alexander Nickolov" <agnickolov@xxxxxxxx> wrote in message
news:ONEMkTnjHHA.3708@xxxxxxxxxxxxxxxxxxxxxxx
HTML is irrelevant for a web server - it doesn't need to understand
HTML. The web server only cares about HTTP - HTML is one of
the possible formats of the data that is being returned. The client
does need to be concerned with HTML, but not the server. With
that said, a server extension that generates HTML will naturally
concern itself with the format. However, the core web server won't
care about that - it only knows its extension interface.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"Andrew McNab" <AndrewMcNab@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:423AF96F-A0D0-4D49-BBE8-6AB8184CB7BD@xxxxxxxxxxxxxxxx
A good starting point would be to start a listener on port 80 with
supporting
code that handles multiple sockets (i.e. multiple clients accessing
the
http
server at the same time).

You can then either find documentation that is relevent to the
proprietry
data format used for sending web page data to clients or obtain a 3rd
party
library that already handles these things. You probably want to start
with
something that parses html files into a function or functions to
process
it
for transmission. I'm not too sure if it's as simple as sending it
byte
for
byte or if it needs a header attached or if special bytes are used to
shorten
standard html tags into a single byte for some sort of compression.

Give the web development forum a shot on specifics for html etc or
references to shipped libraries you can use.






.


Quantcast