help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use regex in ~/.emacs.d/init.el to match no_proxy.


From: Hongyi Zhao
Subject: Use regex in ~/.emacs.d/init.el to match no_proxy.
Date: Tue, 6 Apr 2021 16:22:47 +0800

On Ubuntu 20.04, I set the following proxy settings in ~/.emacs.d/init.el,

;;; begin
(setq url-proxy-services '(
            ("no_proxy" .
"^\\(.*\\.cn\\|localhost\\|10\\..*\\|127\\..*\\|172\\.16\\..*\\|172\\.17\\..*\\|192\\.168\\..*\\)")
            ; "http://127.0.0.1:8080"; doesn't work
            ("http" . "127.0.0.1:8080")
            ("https" . "127.0.0.1:8080")
                          ))
;;; end

As you can see, the "no_proxy" string is rather cumbersome, and I want
to express the following, but I still don't know what to do:

"*.cn,localhost,10.0.0.0/8,127.0.0.0/8,172.16.0.0/12,192.168.0.0/16"

Any hints will be highly appreciated.

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China



reply via email to

[Prev in Thread] Current Thread [Next in Thread]