public boolean readRequest(Socket clientSock) {
        StringBuffer contents = new StringBuffer();

        try {
            InputStream input = clientSock.getInputStream();

            contents = readMessage(input);

            if (contents == null) {
                return false;
            }

            setContentEncodings(contents);
            this.interrimContents = contents.toString();
            this.sock = clientSock;

            this.header = contents.substring(0, contents.indexOf("\r\n"));


            workingContents = new StringBuffer(this.interrimContents.toString());

            if (header.contains("CONNECT") && GizmoView.getView().intercepting()) {
                handle_connect_protocol();
                if (!GizmoView.getView().config().terminateSSL()) {
                    return false;
                }
                this.header = workingContents.substring(0, workingContents.indexOf("\r\n"));
            }
            if (GizmoView.getView().intercepting()) {
                if (header.contains("http")) {
                    url = header.substring(header.indexOf("http"), header.indexOf("HTTP") - 1);
                } else {
                    url = header.substring(header.indexOf("/"), header.indexOf("HTTP") - 1);
                }
                if (url.contains("//")) {
                    host = url.substring(url.indexOf("//") + 2, url.indexOf("/", url.indexOf("//") + 2));
                } else {
                    String upper = workingContents.toString().toUpperCase();
                    int host_start = upper.indexOf("HOST:") + 5;
                    host = workingContents.substring(host_start, upper.indexOf("\n", host_start)).trim();
                }
            }


            this.addContents(workingContents.toString());

        } catch (Exception e) {
            return false;
        }

        return true;
    }