public static String generateWsRemoteAddress(HttpServletRequest request) {
        if (request == null) {
            throw new IllegalArgumentException("HttpServletRequest must not be null.");
        }

        StringBuilder remoteAddress = new StringBuilder();
        String scheme = request.getScheme();
        remoteAddress.append(scheme != null && scheme.equalsIgnoreCase("https") ? "wss://" : "ws://");
        remoteAddress.append(request.getRemoteAddr());
        remoteAddress.append(":");
        remoteAddress.append(request.getRemotePort());
        return remoteAddress.toString();
    }
@Test
    public void testGenerateWsRemoteAddress() {
        HttpServletRequest request = mock(HttpServletRequest.class);
        when(request.getScheme()).thenReturn("http");
        when(request.getRemoteAddr()).thenReturn("localhost");
        when(request.getRemotePort()).thenReturn(8080);

        assertEquals("ws://localhost:8080", HttpTransportUtils.generateWsRemoteAddress(request));
    }