tuohai666 commented on a change in pull request #3056: Replace localhost to real ip address URL: https://github.com/apache/incubator-shardingsphere/pull/3056#discussion_r325976333
########## File path: sharding-proxy/sharding-proxy-frontend/sharding-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/shardingproxy/frontend/mysql/auth/MySQLAuthenticationEngine.java ########## @@ -60,9 +63,10 @@ public boolean auth(final ChannelHandlerContext context, final PacketPayload pay backendConnection.setUserName(response41.getUsername()); context.writeAndFlush(new MySQLOKPacket(response41.getSequenceId() + 1)); } else { - // TODO localhost should replace to real ip address + SocketAddress socketAddress = context.channel().remoteAddress(); + String hostAddress = socketAddress instanceof InetSocketAddress ? ((InetSocketAddress) socketAddress).getAddress().getHostAddress() : socketAddress.toString(); Review comment: Yes, you are right. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services