remove useless code line
[proxy-mode.git] / README.org
blobb6dea1d1eaeaa843c50b7d0a584331e3442348c5
1 * Intro
3 A minor mode to toggle proxy for Emacs. Supports HTTP proxy and socks v4, v5
4 proxy with Emacs built-in functions.
6 This minor mode =proxy-mode= is buffer locally by default. If you want globally
7 proxy in Emacs, use command =global-proxy-mode=.
9 *NOTE*:
10 It supports buffer-local proxy: Emacs http, and Emacs socks.
11 Not support buffer-locally shell environment variable HTTP_PROXY.
13 * Features
15 - Support Emacs built-in HTTP proxy
16 - Support Emacs built-in Socks v4, v5 proxy
17 - Support shell environment HTTP proxy
19 * Installation
21 ** use-package
23 #+begin_src emacs-lisp
24 (use-package proxy-mode
25   :ensure t
26   :custom ((proxy-mode-emacs-http-proxy
27             '(("http"  . "127.0.0.1:7890")
28               ("https" . "127.0.0.1:7890")
29               ;; NOTE: don't use `localhost', avoid local server like robe no response
30               ("no_proxy" . "127.0.0.1")))
31            (proxy-mode-emacs-socks-proxy '("Default server" "127.0.0.1" 7890 5)))
32   :commands (proxy-mode))
33 #+end_src
35 * Config
37 ** specify local host regexp
39 #+begin_src emacs-lisp
40 (setq url-gateway-local-host-regexp
41       (concat "\\`" (regexp-opt '("localhost" "127.0.0.1")) "\\'"))
42 #+end_src
44 * Usage
46 Toggle ~proxy-mode~ minor mode with {{{kbd(M-x proxy-mode RET)}}} .