     200 "HTTP/1.1 200 OK"
     404 "HTTP/1.1 404 Not Found"
     "HTTP/1.1 500 Error"))
-
-(def content-types {".js" "text/javascript"
-                    ".html" "text/html"})
-
-(defn content-type [file-name]
-  (let [idx (.lastIndexOf file-name ".")
-        ext (.substring file-name idx)]
-    (get content-types ext "text/html")))
 
 (defn send-and-close
   "Use the passed connection to send a form to the browser. Send a

  (:require [clojure.string :as str]
            [clojure.java.io :as io]
            [cljs.compiler :as comp]
            [cljs.repl :as repl])
  (:import java.io.BufferedReader
           java.io.BufferedWriter

          (.startsWith line "GET") (read-get line rdr)
          :else {:method :unknown :content line})))

(defn repl-client-js []
  (slurp @(:client-js @server-state)))

(defn send-repl-client-page
  [opts conn request]
  (send-and-close conn 200
    (str "<html><head><meta charset=\"UTF-8\"></head><body>
          <script type=\"text/javascript\">"
         (repl-client-js)
         "</script>"
         "<script type=\"text/javascript\">
          clojure.browser.repl.client.start(\"http://" (-> request :headers :host) "\");
          </script>"
         "</body></html>")
    "text/html"))

(defn handle-get [opts conn request]
  (let [path (:path request)]
    (if (.startsWith path "/repl")
      (send-repl-client-page opts conn request)
      (send-404 conn (:path request)))))

(defn- handle-connection
  [opts conn]
