Lines Matching defs:proxy
1 ;;; url-proxy.el --- Proxy server support
29 (defun url-default-find-proxy-for-url (urlobj host)
31 ((or (and (assoc "no_proxy" url-proxy-services)
34 (assoc "no_proxy" url-proxy-services))
38 ((cdr (assoc (url-type urlobj) url-proxy-services))
39 (concat "PROXY " (cdr (assoc (url-type urlobj) url-proxy-services))))
46 (defvar url-proxy-locator 'url-default-find-proxy-for-url)
48 (defun url-find-proxy-for-url (url host)
49 (let ((proxies (split-string (funcall url-proxy-locator url host) " *; *"))
50 (proxy nil)
52 ;; Not sure how I should handle gracefully degrading from one proxy to
56 (setq proxy (car proxies))
57 (setq proxy proxies))
59 ((string-match "^direct" proxy) nil)
60 ((string-match "^proxy +" proxy)
61 (concat "http://" (substring proxy (match-end 0)) "/"))
62 ((string-match "^socks +" proxy)
63 (concat "socks://" (substring proxy (match-end 0))))
65 (url-warn 'url (format "Unknown proxy directive: %s" proxy) 'critical)
68 (defun url-proxy (url callback &optional cbargs)
69 ;; Retrieve URL from a proxy.
70 ;; Expects `url-using-proxy' to be bound to the specific proxy to use."
71 (setq url-using-proxy (url-generic-parse-url url-using-proxy))
74 ((string= (url-type url-using-proxy) "http")
77 (error "Don't know how to use proxy `%s'" url-using-proxy))))
79 (provide 'url-proxy)
82 ;;; url-proxy.el ends here