From 9bcfef0f10694260a0c066278858b1c528f09ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-R=C3=A9mi=20Desjardins?= Date: Mon, 1 Jun 2015 17:08:55 -0700 Subject: [PATCH] Fix incoherence in WebSocket example Motivation: The logic in the current websocket example is confusing and misleading Modifications: Remove occurrences of "http" and "https" and replace them with "ws" and "wss" Result: The example code is now coherent and is easier to understand for a new user. --- .../example/http/websocketx/client/WebSocketClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/src/main/java/io/netty/example/http/websocketx/client/WebSocketClient.java b/example/src/main/java/io/netty/example/http/websocketx/client/WebSocketClient.java index 8b06516c36..1c5f8af7eb 100644 --- a/example/src/main/java/io/netty/example/http/websocketx/client/WebSocketClient.java +++ b/example/src/main/java/io/netty/example/http/websocketx/client/WebSocketClient.java @@ -61,13 +61,13 @@ public final class WebSocketClient { public static void main(String[] args) throws Exception { URI uri = new URI(URL); - String scheme = uri.getScheme() == null? "http" : uri.getScheme(); + String scheme = uri.getScheme() == null? "ws" : uri.getScheme(); final String host = uri.getHost() == null? "127.0.0.1" : uri.getHost(); final int port; if (uri.getPort() == -1) { - if ("http".equalsIgnoreCase(scheme)) { + if ("ws".equalsIgnoreCase(scheme)) { port = 80; - } else if ("https".equalsIgnoreCase(scheme)) { + } else if ("wss".equalsIgnoreCase(scheme)) { port = 443; } else { port = -1;