@Test public void testWssToHttps() throws URISyntaxException { assertURI(WSURI.toHttp(URI.create("wss: }
public static URI toHttp(final URI inputUri) throws URISyntaxException { Objects.requireNonNull(inputUri, "Input URI must not be null"); String wsScheme = inputUri.getScheme(); if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) { return inputUri; } if ("ws".equalsIgnoreCase(wsScheme)) { return new URI("http" + inputUri.toString().substring(wsScheme.length())); } if ("wss".equalsIgnoreCase(wsScheme)) { return new URI("https" + inputUri.toString().substring(wsScheme.length())); } throw new URISyntaxException(inputUri.toString(), "Unrecognized WebSocket scheme"); }
WSURI { public static URI toHttp(final URI inputUri) throws URISyntaxException { Objects.requireNonNull(inputUri, "Input URI must not be null"); String wsScheme = inputUri.getScheme(); if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) { return inputUri; } if ("ws".equalsIgnoreCase(wsScheme)) { return new URI("http" + inputUri.toString().substring(wsScheme.length())); } if ("wss".equalsIgnoreCase(wsScheme)) { return new URI("https" + inputUri.toString().substring(wsScheme.length())); } throw new URISyntaxException(inputUri.toString(), "Unrecognized WebSocket scheme"); } }
WSURI { public static URI toHttp(final URI inputUri) throws URISyntaxException { Objects.requireNonNull(inputUri, "Input URI must not be null"); String wsScheme = inputUri.getScheme(); if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) { return inputUri; } if ("ws".equalsIgnoreCase(wsScheme)) { return new URI("http" + inputUri.toString().substring(wsScheme.length())); } if ("wss".equalsIgnoreCase(wsScheme)) { return new URI("https" + inputUri.toString().substring(wsScheme.length())); } throw new URISyntaxException(inputUri.toString(), "Unrecognized WebSocket scheme"); }  }
WSURI { public static URI toHttp(final URI inputUri) throws URISyntaxException { Objects.requireNonNull(inputUri, "Input URI must not be null"); String wsScheme = inputUri.getScheme(); if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) { return inputUri; } if ("ws".equalsIgnoreCase(wsScheme)) { return new URI("http" + inputUri.toString().substring(wsScheme.length())); } if ("wss".equalsIgnoreCase(wsScheme)) { return new URI("https" + inputUri.toString().substring(wsScheme.length())); } throw new URISyntaxException(inputUri.toString(), "Unrecognized WebSocket scheme"); }  static URI toHttp(final URI inputUri); static URI toWebsocket(CharSequence inputUrl); static URI toWebsocket(CharSequence inputUrl, String query); static URI toWebsocket(final URI inputUri); }
WSURI { public static URI toHttp(final URI inputUri) throws URISyntaxException { Objects.requireNonNull(inputUri, "Input URI must not be null"); String wsScheme = inputUri.getScheme(); if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) { return inputUri; } if ("ws".equalsIgnoreCase(wsScheme)) { return new URI("http" + inputUri.toString().substring(wsScheme.length())); } if ("wss".equalsIgnoreCase(wsScheme)) { return new URI("https" + inputUri.toString().substring(wsScheme.length())); } throw new URISyntaxException(inputUri.toString(), "Unrecognized WebSocket scheme"); }  static URI toHttp(final URI inputUri); static URI toWebsocket(CharSequence inputUrl); static URI toWebsocket(CharSequence inputUrl, String query); static URI toWebsocket(final URI inputUri);  }