All Downloads are FREE. Search and download functionalities are using the official Maven repository.

meyvn.nrepl_middleware.proxy.clj Maven / Gradle / Ivy

The newest version!
(ns meyvn.nrepl-middleware.proxy
  (:require [meyvn.nrepl-middleware.utils :refer [read-conf]]))

(defn enable-support []
  (let [conf (read-conf "meyvn.edn")]
    (when (get-in conf [:interactive :proxy :enabled])
      (when (get-in conf [:interactive :proxy :socks :enabled])
        (System/setProperty "socksProxyHost" (get-in conf [:interactive :proxy :socks :host] "127.0.0.1"))
        (System/setProperty "socksProxyPort" (get-in conf [:interactive :proxy :socks :port] "1080")))
      (when (get-in conf [:interactive :proxy :http :enabled])
        (System/setProperty "http.proxyHost" (get-in conf [:interactive :proxy :http :host] "127.0.0.1"))
        (System/setProperty "http.proxyPort" (get-in conf [:interactive :proxy :http :port] "1080"))
        (System/setProperty "http.nonProxyHosts" (get-in conf [:interactive :proxy :http :non-proxy-hosts] "")))
      (when (get-in conf [:interactive :proxy :https :enabled])
        (System/setProperty "https.proxyHost" (get-in conf [:interactive :proxy :https :host] "127.0.0.1"))
        (System/setProperty "https.proxyPort" (get-in conf [:interactive :proxy :https :port] "1080"))
        (System/setProperty "http.nonProxyHosts" (get-in conf [:interactive :proxy :https :non-proxy-hosts] ""))))))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy