Original link: https://dosk.win/2022/10/27/jie-jue-chrome-yuan-sheng-gu-ge-fan-yi-gong-nai-de-yi-ge-si-lu-1 -3/
The basic idea
-
In essence,
translate.google.com
andtranslate.googleapis.com
cannot be accessed (which domain names I have not looked at carefully), then we first solve the problem of unreachable access -
You can find a
VPS
that can be accessed as a reverse proxy. Some people say that I can’t apply for certificates for these two domain names, so we can doSNI
proxy directly throughHAProxy
.
base code
global log 127.0.0.1 local3 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon defaults log global option dontlognull option http-server-close option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout http-keep-alive 10s timeout check 10s maxconn 3000 frontend https_proxy mode tcp bind :443 tcp-request inspect-delay 5s tcp-request content accept if { req_ssl_hello_type 1 } acl is_google_translate req_ssl_sni -i translate.google.com use_backend google_translate if is_google_translate backend google_translate server web1 translate.google.com:443
How to eat
-
Find a
VPS
to installHAProxy
and configure the above logic (add other domain names as appropriate) -
The reason why the title of this article is written
1/3
is because after doing this, it is equivalent to physically adding a server toGoogle
, but the domain name has not been resolved, and we have no way to affect everyone’s resolution, so it is temporarily modified here./etc/hosts
implementation, after all, various plug-ins cannot affectChrome
‘s own parsing -
Modifying
/etc/hosts
is more troublesome after all, but now at least it ensures that we don’t need to update things even if theIP
changes in the future -
Forewarning (dig a hole): I will find a way to limit this thing to the scope of
Chrome
applications later. At present, the way I think of is to write a plug-in, start anHTTPDNS
service internally, and then set up inChrome
to usehttp://localhost
for parsing, Maybe I can do other things easily. Of course, the old man who is not bad can buy a domesticVPS
to do this, so that you don’t need to write plug-ins or anything. You can use emmm directly after setting it inChrome
…
This article is reprinted from: https://dosk.win/2022/10/27/jie-jue-chrome-yuan-sheng-gu-ge-fan-yi-gong-nai-de-yi-ge-si-lu-1 -3/
This site is for inclusion only, and the copyright belongs to the original author.