docs: public static String Http(String remotehost, int port, String url) throws Exception {
          Socket s = null;
          s = new Socket(remotehost, port);
          logger.debug("Connected to " + s.getInetAddress().toString() );
  
          if (false) {
              // for serious connection-oriented debugging only
              PrintWriter out = new PrintWriter(s.getOutputStream(), false);
              BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
  
              System.out.println("Sending request");
              out.print("GET " + url + " HTTP/1.1\r\n");
              out.print("Host: " + remotehost + "\r\n");
              out.print("Connection: close\r\n");
              out.print("User-Agent: Expect4j\r\n");
              out.print("\r\n");
              out.flush();
              System.out.println("Request sent");
  
              System.out.println("Receiving response");
              String line;
              while ((line = in.readLine()) != null)
                  System.out.println(line);
              System.out.println("Received response");
              if (line == null)
                  System.exit(0);
          }
  
          Expect4j expect = new Expect4j(s);
  
          logger.debug("Sending HTTP request for " + url);
          expect.send("GET " + url + " HTTP/1.1\r\n");
          expect.send("Host: " + remotehost + "\r\n");
          expect.send("Connection: close\r\n");
          expect.send("User-Agent: Expect4j\r\n");
          expect.send("\r\n");
  
          logger.debug("Waiting for HTTP response");
          String remaining = null;
          expect.expect(new Match[] {
              new RegExpMatch("HTTP/1.[01] \\d{3} (.*)\n?\r", new Closure() {
                  public void run(ExpectState state) {
                      logger.trace("Detected HTTP Response Header");
  
                      // save http code
                      String match = state.getMatch();
                      String parts[] = match.split(" ");
  
                      state.addVar("httpCode", parts[1]);
                      state.exp_continue();
                  }
              }),
              new RegExpMatch("Content-Type: (.*\\/.*)\r\n", new Closure() {
                  public void run(ExpectState state) {
                      logger.trace("Detected Content-Type header");
                      state.addVar("contentType", state.getMatch() );
                      state.exp_continue();
                  }
              }),
              new EofMatch( new Closure() { // should cause entire page to be collected
                  public void run(ExpectState state) {
                      logger.trace("Found EOF, done receiving HTTP response");
                  }
              }), // Will cause buffer to be filled up till end
              new TimeoutMatch(10000, new Closure() {
                  public void run(ExpectState state) {
                      logger.trace("Timeout waiting for HTTP response");
                  }
              })
          });
  
          remaining = expect.getLastState().getBuffer(); // from EOF matching
  
          String httpCode = (String) expect.getLastState().getVar("httpCode");
  
          String contentType = (String) expect.getLastState().getVar("contentType");
  
          s.close();
  
          return remaining;
      }