(→테스트 2) |
(→테스트 2) |
||
39번째 줄: | 39번째 줄: | ||
==테스트 2== | ==테스트 2== | ||
{{소스헤더|http 테스트}} | |||
<syntaxhighlight lang='console'> | <syntaxhighlight lang='console'> | ||
testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/ | head -1 | testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/ | head -1 | ||
46번째 줄: | 47번째 줄: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='console'> | <syntaxhighlight lang='console'> | ||
testuser@localhost:~$ curl -sI -x | testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 http://github.com/ | head -1 | ||
HTTP/1.1 | HTTP/1.1 301 Moved Permanently | ||
testuser@localhost:~$ docker logs proxy -n1 | testuser@localhost:~$ docker logs proxy -n1 | ||
172.18.0.1 - - [29/Aug/2022:08: | 172.18.0.1 - - [29/Aug/2022:08:30:29 +0000] "HEAD http://github.com/ HTTP/1.1" 301 0 "-" "curl/7.74.0" "-" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{소스헤더|https 테스트}} | |||
<syntaxhighlight lang='console'> | <syntaxhighlight lang='console'> | ||
testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 | testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 https://raw.githubusercontent.com/anak10thn/WTFPL/master/LICENSE.txt | head -1 | ||
HTTP/1.1 | HTTP/1.1 200 Connection Established | ||
testuser@localhost:~$ docker logs proxy -n1 | testuser@localhost:~$ docker logs proxy -n1 | ||
172.18.0.1 - - [29/Aug/2022:08: | 172.18.0.1 - - [29/Aug/2022:08:32:17 +0000] "CONNECT raw.githubusercontent.com:443 HTTP/1.1" 200 4982 "-" "curl/7.74.0" "-" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='console'> | <syntaxhighlight lang='console'> |
2022년 8월 29일 (월) 17:36 판
1 개요
- nginx-forward-proxy
- docker run nginx-forward-proxy
Console
Copy
testuser@localhost:~$ curl -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/
curl: (7) Failed to connect to 127.0.0.1 port 3128: Connection refused
Console
Copy
testuser@localhost:~$ docker run -d --name proxy -p 3128:3128 hinata/nginx-forward-proxy:latest
242d7163b9b678f1893edeca4902364bcff70765ce24a890c8079c26abf57235
2 테스트 1
http 테스트
Console
Copy
testuser@localhost:~$ curl -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
https 테스트
Console
Copy
testuser@localhost:~$ curl -sx http://127.0.0.1:3128 https://raw.githubusercontent.com/anak10thn/WTFPL/master/LICENSE.txt | head -1
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
3 테스트 2
http 테스트
Console
Copy
testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 http://www.wtfpl.net/txt/copying/ | head -1
HTTP/1.1 200 OK
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:33:18 +0000] "GET http://www.wtfpl.net/txt/copying/ HTTP/1.1" 200 498 "-" "curl/7.74.0" "-"
Console
Copy
testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 http://github.com/ | head -1
HTTP/1.1 301 Moved Permanently
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:30:29 +0000] "HEAD http://github.com/ HTTP/1.1" 301 0 "-" "curl/7.74.0" "-"
https 테스트
Console
Copy
testuser@localhost:~$ curl -sI -x http://127.0.0.1:3128 https://raw.githubusercontent.com/anak10thn/WTFPL/master/LICENSE.txt | head -1
HTTP/1.1 200 Connection Established
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:32:17 +0000] "CONNECT raw.githubusercontent.com:443 HTTP/1.1" 200 4982 "-" "curl/7.74.0" "-"
Console
Copy
testuser@localhost:~$ curl -sI -x 127.0.0.1:3128 https://github.com/ | head -1
HTTP/1.1 200 Connection Established
testuser@localhost:~$ docker logs proxy -n1
172.18.0.1 - - [29/Aug/2022:08:31:02 +0000] "CONNECT github.com:443 HTTP/1.1" 200 6144 "-" "curl/7.74.0" "-"