amate / Proxydomo

ローカルで動作するプロクシフィルタリングソフトです
http://www31.atwiki.jp/lafe/pages/37.html
GNU General Public License v2.0
73 stars 12 forks source link

[Bug] HTTPS connection, "$SETPROXY" #30

Closed sanitoT closed 8 years ago

sanitoT commented 8 years ago

some connection: "My PC" ===============> "Website A (http)" or "Website B (https)", <Response 200> "My PC" ====>[Firewall]---x-- "Website C (http)" or "Website D (https)", <Response 503> "My PC" ====>[Proxy]====> "Website A (http)" or "Website B (https)", <Response 200> "My PC" ====>[Proxy]====> "Website C (http)" or "Website D (https)", <Response 200>

set proxydomo: [HTTP headers] Key = "URL: Proxy 1" In = FALSE Out = TRUE URL = "$LST(ProxyURL)" Match = "" Replace = "$SETPROXY(127.0.0.1:8118)"

ProxyURL.txt: ([^/]++.|)websitea.aaaa/ ([^/]++.|)websiteb.bbbb/ ([^/]++.|)websitec.cccc/ ([^/]++.|)websited.dddd/

Result: "Website A(http), C(http)", Log >>> HeaderMatch [Proxy 1], <Response 200> "Website B(https)", Log >>> (sometimes not match?), <Response 200> "Website D(https)", Log >>> (Not Match), <Response 503>

amate commented 8 years ago

v1.77 fixed

sanitoT commented 8 years ago

@amate v1.77 still not match

Log:

>>> port 62185 : New request received
#11 : HeaderMatch [Proxy URL] 
#11 : Match the list [ProxyURL] line 1
>>> port 62185 #11 : Request sent to website
GET http://www.google.com/ HTTP/1.1           <-HTTP
Host: www.google.com
┋
Connection: keep-alive

>>> port 62185 #11 : Response sent to browser
HTTP/1.1 302 Found
Location: https://www.google.com/?gws_rd=ssl      <-HTTPS
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Wed, 06 Jan 2016 16:52:14 GMT
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Connection: close
Transfer-Encoding: chunked

>>> port 62185 : Request ended
>>> port 62190 : New request received         <-302 https
>>> port 62190 #12 : Response sent to browser
HTTP/1.1 503 Service Unavailable
Content-Type: text/html
Content-Length: 133
Connection: close

>>> port 62190 : Request ended
amate commented 8 years ago

I wasn't able to reproduce the problem.

ProxyURL.txt www.google.com/ www.google.co.jp/

>>> ポート 54047 #9647 : ブラウザ → Proxy(this)
GET http://www.google.com/ HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host: www.google.com
Proxy-Connection: Keep-Alive
Cookie: NID=71=C0VJxCGNNXffPBdsRZHQHZAwP3fGqIvCcAWrt-PM-SHjvQOjfcbXdniuFOBcllUT8mN82al-P927yOw8gLQNAxSptonQDT75NWJQypKnC8b7F_3lPoatJCs6J8zSgQnU; OGPC=5-1:

#9647 : HeaderMatch [Proxy 1] 
#9647 : ListMatch [ProxyURL] 1 行目
>>> ポート 54047 #9647 : Proxy(this) → サイト
GET http://www.google.com/ HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host: www.google.com
Cookie: NID=71=C0VJxCGNNXffPBdsRZHQHZAwP3fGqIvCcAWrt-PM-SHjvQOjfcbXdniuFOBcllUT8mN82al-P927yOw8gLQNAxSptonQDT75NWJQypKnC8b7F_3lPoatJCs6J8zSgQnU; OGPC=5-1:
Connection: Keep-Alive

>>> ポート 54047 #9647 : Proxy(this) ← サイト
HTTP/1.1 302 Found
Via: 1.1 hvscan:8080 (ScanHTTP)
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO
Content-Length: 259
Date: Wed, 06 Jan 2016 21:01:30 GMT
Server: GFE/2.0
Connection: close

>>> ポート 54047 #9647 : ブラウザ ← Proxy(this)
HTTP/1.1 302 Found
Via: 1.1 hvscan:8080 (ScanHTTP)
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO
Date: Wed, 06 Jan 2016 21:01:30 GMT
Server: GFE/2.0
Connection: close
Transfer-Encoding: chunked

>>> ポート 54049 #9648 : ブラウザ → Proxy(this)
GET http://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
Host: www.google.co.jp
Cookie: NID=73=s-jE1Elka23F7qbWb6R_NemkZb0Ui2CAghDNRF-_LmxydeQYE0MRADqhP4eQyLx-ioQ7kCjvo0WOqF9mWDnIBan8poeIKsIlVIEojqYFOLxhi0UuJlpvPfFOTr-dmIdxAuCfAm8s4gb6-dwMRd2hKJOCLl1aoXsXyPtok-O2aq5ZAaS9bXze-SKlcA; OGPC=5-3:; OGP=-5:

#9648 : HeaderMatch [Proxy 1] 
#9648 : ListMatch [ProxyURL] 8 行目
>>> ポート 54049 #9648 : Proxy(this) → サイト
GET http://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host: www.google.co.jp
Cookie: NID=73=s-jE1Elka23F7qbWb6R_NemkZb0Ui2CAghDNRF-_LmxydeQYE0MRADqhP4eQyLx-ioQ7kCjvo0WOqF9mWDnIBan8poeIKsIlVIEojqYFOLxhi0UuJlpvPfFOTr-dmIdxAuCfAm8s4gb6-dwMRd2hKJOCLl1aoXsXyPtok-O2aq5ZAaS9bXze-SKlcA; OGPC=5-3:; OGP=-5:
Connection: Keep-Alive

>>> ポート 54049 #9648 : Proxy(this) ← サイト
HTTP/1.1 302 Found
Via: 1.1 hvscan:8080 (ScanHTTP)
Location: https://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO&gws_rd=ssl
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Wed, 06 Jan 2016 21:01:30 GMT
Server: gws
Content-Length: 275
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Connection: close

>>> ポート 54049 #9648 : ブラウザ ← Proxy(this)
HTTP/1.1 302 Found
Via: 1.1 hvscan:8080 (ScanHTTP)
Location: https://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO&gws_rd=ssl
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Wed, 06 Jan 2016 21:01:30 GMT
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Connection: close
Transfer-Encoding: chunked

>>> ポート 54051 #9650 : ブラウザ → Proxy(this)
CONNECT www.google.co.jp:443 HTTP/1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
Host: www.google.co.jp:443
Content-Length: 0
Proxy-Connection: Keep-Alive
Pragma: no-cache

>>> ポート 54051 #9650 : ブラウザ ← Proxy(this)
HTTP/1.0 200 Connection established
Proxy-agent: Proxydomo/1.0

>>> ポート 54051 #9651 : ブラウザ → Proxy(this)
GET /?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO&gws_rd=ssl HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host: www.google.co.jp
Connection: Keep-Alive
Cookie: NID=73=s-jE1Elka23F7qbWb6R_NemkZb0Ui2CAghDNRF-_LmxydeQYE0MRADqhP4eQyLx-ioQ7kCjvo0WOqF9mWDnIBan8poeIKsIlVIEojqYFOLxhi0UuJlpvPfFOTr-dmIdxAuCfAm8s4gb6-dwMRd2hKJOCLl1aoXsXyPtok-O2aq5ZAaS9bXze-SKlcA; OGPC=5-3:; OGP=-5:

#9651 : HeaderMatch [Proxy 1] 
#9651 : ListMatch [ProxyURL] 8 行目
>>> ポート 54051 #9651 : Proxy(this) → サイト
GET https://www.google.co.jp/?gfe_rd=cr&ei=qoCNVsR-pMPwB9CMoagO&gws_rd=ssl HTTP/1.1
Accept: */*
Accept-Language: ja-JP
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; Trident/7.0; rv:11.0) like Gecko
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
Host: www.google.co.jp
Connection: Keep-Alive
Cookie: NID=73=s-jE1Elka23F7qbWb6R_NemkZb0Ui2CAghDNRF-_LmxydeQYE0MRADqhP4eQyLx-ioQ7kCjvo0WOqF9mWDnIBan8poeIKsIlVIEojqYFOLxhi0UuJlpvPfFOTr-dmIdxAuCfAm8s4gb6-dwMRd2hKJOCLl1aoXsXyPtok-O2aq5ZAaS9bXze-SKlcA; OGPC=5-3:; OGP=-5:

>>> ポート 54051 #9651 : Proxy(this) ← サイト
HTTP/1.1 200 OK
Date: Wed, 06 Jan 2016 21:01:30 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic="www.google.com:443"; ma=600; v="30,29,28,27,26,25",quic=":443"; ma=600; v="30,29,28,27,26,25"
Transfer-Encoding: chunked

>>> ポート 54051 #9651 : ブラウザ ← Proxy(this)
HTTP/1.1 200 OK
Date: Wed, 06 Jan 2016 21:01:30 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Alternate-Protocol: 443:quic,p=1
Alt-Svc: quic="www.google.com:443"; ma=600; v="30,29,28,27,26,25",quic=":443"; ma=600; v="30,29,28,27,26,25"
Transfer-Encoding: chunked
sanitoT commented 8 years ago

@amate Add an invalid proxy in "Remote HTTP Proxy", and set as default. Activate "Use Remote Proxy" Clear browser's cache All websites -> response 503 "$SETPROXY" use a valid proxy

URL rule Visit website Result
aaa.bbb/ https://aaa.bbb Not Match
aaa.bbb/ http://aaa.bbb Match
aaa.bbb https://aaa.bbb Match
aaa.bbb http://aaa.bbb Match
aaa.bbb/ http://aaa.bbb.ccc Not Match (right)
aaa.bbb http://aaa.bbb.ccc Match
amate commented 8 years ago

v1.78 fixed