DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18579>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18579

Added  header X-Forwarded-Port

           Summary: Added  header X-Forwarded-Port
           Product: Apache httpd-1.3
           Version: 1.3.27
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: mod_proxy
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


As we needed Apache with mod_proxy as accelerator for a java web server, we had
the problem that the proxied server needed location awareness but could retrieve
the client's port address. The clients ip address is read from the header
X-Forwarded-For, for the remote port informationen, we added the following code
snippet to mod_proxy so that it creates  X-Forwarded-Port as an additional
request header. 

 /* Add X-Forwarded-Server: so that upstream knows what the
         * name of this proxy server is (if there are more than one)
         * XXX: This duplicates Via: - do we strictly need it?
         */
        ap_table_mergen(req_hdrs, "X-Forwarded-Server", 
r->server->server_hostname);

        /** ADDED BY MICHAEL SZALAY */

        /* Add  X-Forwarded Port: some webservers need to know this
         */
         int remote_port = r->connection->remote_addr.sin_port;

         /* use sprintf to convert string to int */
         char str[50];
         int i;
         i = sprintf(str, "%d", remote_port);

         /* put into header */
         ap_table_mergen(req_hdrs, "X-Forwarded-Port", str);

         /* END ADDED BY MICHAEL SZALAY */

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to