trick for today -> autoproxy

Started by newdep, May 22, 2009, 05:21:08 AM

Previous topic - Next topic

newdep

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">http://wpad."

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

      (string "http://" $1)))
-- (define? (Cornflakes))