@Override
    public void run() {
        try {
            String s;
            RequestHandler requester = new RequestHandler(conf);

            while((s = in.readLine()) != null) {
                if(s.isEmpty())
                    break;
                requester.read(s);
            }
            requester.handle();
            requester.checkForError();
            long id = Thread.currentThread().getId();
            System.out.println("[" + id + "] '" + requester.getMethod() + "'");
            System.out.println("[" + id + "] '" + requester.getPath() + "'");
            System.out.println("[" + id + "] '" + requester.getHttpVersion() + "'");
            System.out.println("[" + id + "] '" + requester.getRequestHost() + "'");
            System.out.println("[" + id + "] '" + requester.getRequestPort() + "'");
            System.out.println("[" + id + "] '" + requester.getUserAgent() + "'");
            System.out.println("[" + id + "] 'MimeTypes:'");
            for(String mimeType : requester.acceptedMimeTypes()) {
                System.out.println("[" + id + "] '" + mimeType + "'");
            }

            requester.setFile(getRealFile(requester.getPath()));
            System.out.println(requester.getFile().getAbsolutePath());
            System.out.println(requester.getRealPath());
            if(requester.hadError()) {
                errorAnswer();
            } else {
                try {
                    Answer a = getModule(requester.getFile()).onRequest(requester);
                    sendHead(a);
                    sendBody(a);
                } catch (Throwable t) {
                    errorAnswer();
                }
            }
        } catch (IOException io) {
            io.printStackTrace();
        }
        try {
            out.close();
            in.close();
            client.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }