newLISP Fan Club

Forum => So, what can you actually DO with newLISP? => Topic started by: newdep on May 22, 2009, 05:21:08 AM

Title: trick for today -> autoproxy
Post by: newdep on May 22, 2009, 05:21:08 AM
Quote
;; Auto proxy discovery from network

;; straight grep from wpat.dat file

;; and set newlisp proxy

;; assumes host.domain

;;

(env "HTTP_PROXY"

 (and

  (regex "PROXY (.*); "

   (get-url

    (append "http://wpad."

     (join (-2 (parse (net-lookup (net-interface)) "." )) ".") "/wpad.dat")))

      (string "http://" $1)))