public InputStream stream(String url) throws IOException {

    int redirects = 0;
    URLConnection conn;
    do {
      conn = LLHttpClient.connect(proxy(), "GET", url, connectTimeOut, readTimeOut, headers());
      url = check(cookies(conn));
      redirects++;
    } while (follow && url != null && redirects < 5);

    if (follow && redirects >= 5 && conn != null && conn instanceof HttpURLConnection) {
      if (((HttpURLConnection) conn).getResponseCode() != HttpURLConnection.HTTP_OK) { throw new IOException(
          "Detected recursive redirecting: " + url); }
    }

    return LLHttpClient.getInputStream(conn);
  }