                     (reset! proxy-switch false))))))))
 
 (defn apply-proxy-settings! [e]
-  (let [c {:mode "fixed_servers"
-           :rules {:singleProxy {:scheme "socks5"
-                                  :host "localhost"
-                                  :port 11032}}}
-        d (clj->js {:value c :scope "regular"})]
+  (let [c (make-proxy-settings! (value (by-id "proxy_uri")))
+        d (clj->js c)]
     (.preventDefault e.evt)
     (.stopPropagation e.evt)
+    (.log js/console d)
     (.set js/chrome.proxy.settings
-          d
-          (fn [s]
-            (.log js/console (js->clj s))
-            (swap! proxy-settings
-                   (fn [v] (conj v (js->clj proxy-settings))))))
+          d (fn [s]
+              (.log js/console (js->clj s))))
     (.sendRequest js/chrome.extension {:type "clearError"})))
 
 (defn clear-proxy-settings! []

      false)))

(set! (.-onreadystatechange js/document) on-doc-ready)


                                     :system]
                               :run ["pac_script"
                                     "fixed_servers"]})

(declare make-proxy-settings!)

(defn set-link! [id uri]
  (set-attr! (by-id id) :href (.getURL js/chrome.runtime uri)))
