code: private String getWebSocketURL(HttpRequest req) {
          String protocol = Constants.WS_SCHEME;
          if (secureConnection) {
              protocol = Constants.WSS_SCHEME;
          }
          return protocol + "://" + req.headers().get("Host") + req.uri();
      }
docs: /* Get the URL of the given connection