6
6

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 3 years have passed since last update.

docker イメージを使った squid によるプロキシサーバー

Last updated at Posted at 2020-09-11

squid によるプロキシサーバー

https://hub.docker.com/r/minimum2scp/squid の docker イメージを使った場合

Ubuntu 20.04 上で確認しました。

Ubuntu 側の設定

docker run --rm --name proxy-squid -d -p 3128:3128 minimum2scp/squid
sudo apt install -y firewalld
sudo firewall-cmd --zone=public --add-port=3128/tcp  --permanent
sudo firewall-cmd --reload

※ 再起動後も自動的に docker container を再起動する場合は以下のように --restart always をつけて、--rm を外す

docker run --restart always --name proxy-squid -d -p 3128:3128 minimum2scp/squid

クライアント

プロキシサーバー上で試す場合

curl  --proxy http://localhost:3128 https://www.yahoo.co.jp

別のマシンで試す場合

proxy.address はプロキシのアドレス

curl  --proxy http://proxy.address:3128 https://www.yahoo.co.jp
6
6
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
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?