# Java Log Client IP using send-proxy header

**URL:** https://discourse.haproxy.org/t/java-log-client-ip-using-send-proxy-header/6897
**Category:** Help!
**Created:** [September 10, 2021, 9:54am UTC](https://discourse.haproxy.org/t/java-log-client-ip-using-send-proxy-header/6897 "2021-09-10T09:54:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![void\_in](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@void\_in](https://discourse.haproxy.org/u/void_in)
#### Post date: [September 10, 2021, 9:54am UTC](https://discourse.haproxy.org/t/java-log-client-ip-using-send-proxy-header/6897/1 "2021-09-10T09:54:38Z")

</div>

Hi  
Have anyone configured a java application to log client IP when the java application is running behind haproxy in tcp mode and the haproxy is configured to send the “send-proxy” header. A sample configuration is given below:

frontend myfrontend  
bind 0.0.0.0:1000  
mode tcp  
retries 3  
option redispatch  
option clitcpka  
timeout client 300s  
timeout server 300s  
option tcplog  
default\_backend mybackend

backend mybackend  
mode tcp  
server SERVER-1 1.1.1.1:1000 check send-proxy

The java application is running on the 1.1.1.1 backend server and I want to log the original client IP addresses. Right now when the IP address is logged through InetAddress.getLocalHost();

I am using HAproxy 2.4.4 which is the latest version right now.

Thank you very much.
