Here you can find the source of resolveWsURI(String url)
static URI resolveWsURI(String url)
//package com.java2s; //License from project: Apache License import java.net.URI; public class Main { static URI resolveWsURI(String url) { return url.startsWith("http") ? URI.create(url.replaceFirst("http", "ws")) : url.startsWith("https") ? URI.create(url.replaceFirst("https", "wss")) : URI.create(url); }/*from w w w . ja v a 2s .co m*/ }