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

Re: no-proxy



>>>>> In [emacs-w3m : No.02913]
>>>>>	Katsumi Yamaoka <yamaoka@jpl.org> wrote:

山岡> 会社の外の web ページを見るときは proxy サーバー経由で接続、
山岡> 会社の中の web ページを見るときも proxy サーバー経由で接続できる
山岡> が、中には proxy サーバー経由では見せてくれないものがある、とい
山岡> うような場合に使えるユーザープションを作ってみました (幹)。

山岡> w3m-command-arguments-alist's value is nil

すみませんが、ちょっと意味を変えました。

最初に作ったのは接続先のホスト毎に w3m コマンドに与える引数を切
り替えるものでしたが、同じホストでもページによって与える引数を切
り替えられるようにしておいた方が良かろうと思いまして、各要素の
car 項は url との比較を行なうようにしました。

しかし当初の目的であった、ホスト毎に proxy を使うかどうかを決め
るためには、ユーザーがいささか複雑な正規表現を設計しなければなら
ないので、w3m-no-proxy-hosts というオプションでもっと簡単に設定
することもできるようにしました。例えば

(setq w3m-no-proxy-hosts
      '("www.local.net" "www.neighbor.net"))

のようにしておくと、このリストに含まれるホストに接続するときは
w3m コマンドの引数に "-no-proxy" を追加します。ぼくの場合、実は
これだけで事足りるのですが。^^;;

w3m-command-arguments-alist's value is nil

Documentation:
*Alist of a regexp matching urls and additional arguments passed to
the w3m command.  This lets you, for instance, use or not use proxy
server for the particular hosts.  The first match made will be used.
Here is an example of how to set this option:

(setq w3m-command-arguments-alist
      '(;; Don't use any additional options to visit local web pages.
	("^http://\\([^/]*\\.\\)*your-company\\.com\\(/\\|$\\)"
	 "-no-proxy")
	;; Use the proxy server to visit any foreign urls.
	(""
	 "-o" "http://proxy.your-company.com:8080/")))

Where the first element matches the url that the scheme is "http" and
the hostname is either "your-company.com" or a name ended with
".your-company.com".  If you are a novice on the regexps, you can use
the option `w3m-no-proxy-hosts' instead.


w3m-no-proxy-hosts's value is nil

Documentation:
*List of hostnames that emacs-w3m will not use a proxy server to
connect to.  Each element should be exactly a name of a host machine,
not a regexp.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>