Skip to content

Commit

Permalink
fix parse ipv6 from address in haproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
yuz10 authored Jun 5, 2024
1 parent 7558850 commit 2b580c6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ protected HAProxyMessage buildHAProxyMessage(Channel inboundChannel) throws Ille
}
} else {
String remoteAddr = RemotingHelper.parseChannelRemoteAddr(inboundChannel);
sourceAddress = StringUtils.substringBefore(remoteAddr, CommonConstants.COLON);
sourceAddress = StringUtils.substringBeforeLast(remoteAddr, CommonConstants.COLON);
sourcePort = Integer.parseInt(StringUtils.substringAfterLast(remoteAddr, CommonConstants.COLON));

String localAddr = RemotingHelper.parseChannelLocalAddr(inboundChannel);
destinationAddress = StringUtils.substringBefore(localAddr, CommonConstants.COLON);
destinationAddress = StringUtils.substringBeforeLast(localAddr, CommonConstants.COLON);
destinationPort = Integer.parseInt(StringUtils.substringAfterLast(localAddr, CommonConstants.COLON));
}

Expand Down

0 comments on commit 2b580c6

Please sign in to comment.