[squid-users] FEATURE-Request - client ip and port or username

From: Rainer Anschober <[email protected]>
Date: Wed, 05 Jan 2005 13:41:39 +0100

Thank you for your response.
Now, we have resolved the problem. My coworker Hansjoerg Rainer has
added some code to following files:

enums.h
structs.h
http.c
HttpHeader.c
client_side.c

Now, the webserver can read two new variables ( HTTP_CLIENT_ADDR and
HTTP_CLIENT_PORT ). Our Webapplication now can read the ip address and
the port of the client webbrowser. We need this in order to make an
ident questions to the client in order to get the loginname of the user,
who want to serve this server.

Is it possible to add this feature in the original source code? Perhaps
with an switch in the configfile like i can turn on or off the
information HTTP_X_FORWARDED_FOR?

I am happy if it possible to add this code. And i make available the
changed sourcefiles.

with best regards
Rainer Anschober

Our basis was squid-2.5.STABLE7. The result of a diff over this five:

File *** client_side.c ***
3086d3085
< request->client_port = ntohs(conn->peer.sin_port);

File *** enums.h ***
240,241d239
< HDR_CLIENT_ADDR,
< HDR_CLIENT_PORT,

File *** http.c ***
897,898d896
< case HDR_CLIENT_ADDR:
< case HDR_CLIENT_PORT:
923,925d920
< httpHeaderPutStr(hdr_out, HDR_CLIENT_ADDR,
inet_ntoa(orig_request->client_addr) );
< httpHeaderPutStrf(hdr_out, HDR_CLIENT_PORT, "%d", (int)
(orig_request->client_port) );
<

File *** HttpHeader.c ***
127,128d126
< {"Client-Addr", HDR_CLIENT_ADDR, ftStr},
< {"Client-Port", HDR_CLIENT_PORT, ftStr},
215c213
< HDR_USER_AGENT, HDR_X_FORWARDED_FOR, HDR_CLIENT_ADDR,
HDR_CLIENT_PORT

---
>     HDR_USER_AGENT, HDR_X_FORWARDED_FOR
File *** structs.h ***
1674d1673
<     unsigned short client_port; // rainer
Received on Wed Jan 05 2005 - 05:41:43 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 07 2005 - 12:59:35 MST