1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

http_proxy変数でネット制限が便利

Last updated at Posted at 2014-01-08

proxyのありがたさを感じてきた。

  • DBサーバーのようにネットに直接接続できないサーバーでもproxyサーバー経由でネットにアクセスできる。
    • ネットにさらしていないので安心。
  • ユーザーごとにネット接続が可/不可が可能。
そのままだとネットにアクセス出来ない環境ですが・・・
$ wget http://i.gzn.jp/images/logo.png
--2014-01-08 20:27:56--  http://i.gzn.jp/images/logo.png
Resolving i.gzn.jp (i.gzn.jp)... failed: Connection timed out.
wget: unable to resolve host address ‘i.gzn.jp’
http_proxyをセットすることでネットにアクセスできます。
$ http_proxy=http://192.168.11.23:3216/ wget http://i.gzn.jp/images/logo.png
--2014-01-08 20:28:10--  http://i.gzn.jp/images/logo.png
Connecting to 192.168.11.23:3216... connected.
Proxy request sent, awaiting response... 200 OK
Length: 5026 (4.9K) [image/png]
Saving to: ‘logo.png’

100%[==========================================================>] 5,026       --.-K/s   in 0.02s

2014-01-08 20:28:10 (260 KB/s) - ‘logo.png’ saved [5026/5026]
  • 認証が必要な場合は以下のように指定します。
    • http_proxy=http://ユーザ名:パスワード@192.168.11.23:3216/
  • export http_proxyしておけば、apt-getでパッケージのインストールも可能。
  • httpsはhttps_proxyをセットします。
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?