private String getUpstreamIp() {
        ShenyuContext shenyuContext = exchange.getAttribute(Constants.CONTEXT);
        assert shenyuContext != null;
        if (RpcTypeEnum.HTTP.getName().equals(shenyuContext.getRpcType())) {
            URI uri = exchange.getAttribute(Constants.HTTP_URI);
            if (Objects.nonNull(uri)) {
                return uri.getHost();
            } else {
                return getUpstreamIpFromHttpDomain();
            }
        } else {
            String domain = (String) exchange.getAttributes().get(Constants.HTTP_DOMAIN);
            if (StringUtils.isNotBlank(domain)) {
                return getUpstreamIpFromHttpDomain();
            }
            // The current context is difficult to obtain the upstream IP of grpc and Dubbo. need change plugin code.
        }
        return "";
    }
@Test
    public void testGetUpstreamIp() throws Exception {
        loggingServerHttpResponse.setExchange(exchange);
        Method method1 = loggingServerHttpResponse.getClass().getDeclaredMethod("getUpstreamIp");
        method1.setAccessible(true);
        String upstreamIp1 = (String) method1.invoke(loggingServerHttpResponse);
        Assertions.assertEquals(upstreamIp1, "");
        exchange.getAttributes().put(Constants.HTTP_DOMAIN, "http://localhost:9195/http/order/path/123/name");
        loggingServerHttpResponse.setExchange(exchange);
        Method method2 = loggingServerHttpResponse.getClass().getDeclaredMethod("getUpstreamIp");
        method2.setAccessible(true);
        String upstreamIp2 = (String) method2.invoke(loggingServerHttpResponse);
        Assertions.assertEquals(upstreamIp2, "localhost");
        ShenyuContext shenyuContext2 = new ShenyuContext();
        shenyuContext2.setRpcType("http");
        exchange.getAttributes().put(Constants.CONTEXT, shenyuContext2);
        loggingServerHttpResponse.setExchange(exchange);
        Method method3 = loggingServerHttpResponse.getClass().getDeclaredMethod("getUpstreamIp");
        method3.setAccessible(true);
        String upstreamIp3 = (String) method3.invoke(loggingServerHttpResponse);
        Assertions.assertEquals(upstreamIp3, "localhost");
        exchange.getAttributes().put(Constants.HTTP_URI, new URI("test", "localhost", "/test", "test"));
        loggingServerHttpResponse.setExchange(exchange);
        Method method4 = loggingServerHttpResponse.getClass().getDeclaredMethod("getUpstreamIp");
        method4.setAccessible(true);
        String uri = (String) method4.invoke(loggingServerHttpResponse);
        Assertions.assertEquals(uri, "localhost");
    }