As far as I know, a (HTTP) server works somehow like this:
1. Listen for a connection and accept incoming connections.
2. If the file referred to is a plain file, send it back to the client, otherwise (if it's a CGI file or an executable file):
- a. Make a pipe for the standard input and put the request into it.
- b. Make a pipe for the standard output.
- c. Call the script or executable file with hStdIn and hStdOut (, ...) set to the pipes made earlier.
- d. Send the data from the standard output pipe to the client.
Correct me if I'm wrong, in any of the steps.
I just don't understand where or how the remote IP address is passed to the CGI script or executable. Does anyone know?
How Does A Server Tell The CGI The Remote IP Address? (HTTP)
Started by RhetoricalRuvim, May 30 2011 12:43 PM
2 replies to this topic
#1
Posted 30 May 2011 - 12:43 PM
|
|
|
#2
Posted 30 May 2011 - 01:23 PM
The server will set environmental variables available to the shell of which runs the CGI program, Apache could use mod_env for example.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 30 May 2011 - 02:28 PM
What Win32 API functions do that?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









