public HttpServer(int port, String baseDir, HttpRequestHandler httpRequestHandler) {
        try (
                ServerSocket serverSocket = new ServerSocket(port)
        ) {
            serverSocket.setReuseAddress(true);

            while(true) {
                Socket socket = serverSocket.accept();
                httpRequestHandler.parseAndHandleRequest(socket, baseDir);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
     }