hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roland Weber (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCORE-111) Provide method to get remote_ip, URI and status
Date Tue, 28 Aug 2007 17:35:31 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523289
] 

Roland Weber commented on HTTPCORE-111:
---------------------------------------

Hello Hubert,

the remote IP address is available from a connection that implements the optional interface
HttpInetConnection.
HttpRequestHandler.handleRequest has an HttpContext argument, the connection should be available
in the context.

Please provide details of "some IO Exception".
Our NIO expert should be back next week and will probably be able to help you then.

cheers,
  Roland


> Provide method to get remote_ip, URI and status
> -----------------------------------------------
>
>                 Key: HTTPCORE-111
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-111
>             Project: HttpComponents Core
>          Issue Type: New Feature
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha5
>         Environment: Ubuntu Linux
>            Reporter: Hubert Sieh
>            Priority: Minor
>
> Following your example for the basic, non-blocking HTTP server, I am trying to simulate
the info that you would get from the standard apache httpd daemon, e.g.  remote IP, URI and
return code that is typically found in access.log.
> First, I tried getting this information from the EventLogger/EventListener
>             if (conn instanceof DefaultNHttpServerConnection)
>             {
>             	DefaultNHttpServerConnection d = (DefaultNHttpServerConnection) conn;
>             	logger.info("connection from " + d.getRemoteAddress().getHostAddress());
>             	logger.info("requested: " + d.getHttpRequest().getRequestLine().getUri());
>             	logger.info("responded: " + d.getHttpResponse().getStatusLine().getStatusCode());
>             }
> ... but this causes some IO/Exception
> Second, I tried logging this from the handle method in your HttpRequestHandler, but I
do not see how I can get the remote IP address.
> Seems like I can get the remote IP from the eventlistener, but not the URI and status
code.
> Or I can get the URI and status code from the httprequesthandler, but not the remote
IP.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message