code: public void stop() {
      try {
        if (server != null) {
          server.stop();
          server.join();
        }
      } catch (Exception e) {
        LOG.warn("Got exception shutting down proxy", e);
      }
    }
docs: Stop all server threads and wait for all to finish.