An idea to solve Chrome’s native Google Translate function: 3/3

Original link: https://dosk.win/2022/11/04/jie-jue-chrome-yuan-sheng-gu-ge-fan-yi-gong-nai-de-yi-ge-si-lu-3 -3/

continue from above

Solution: After a wave of testing, only DoH is more reliable. After searching around, I found HUAWEI CLOUD functions, which can be used for free.

  1. Register HUAWEI CLOUD, create a new cloud function, the default Nodejs is fine, the trigger is HTTP , the name is very important, it must be called dns-query because I am too lazy to change the configuration

  2. Run dnsmasq inside and configure your hard-coded parsing records. Both translate.google.com and translate.googleapis.com are required. In the previous article, only the former was demonstrated, and it should be added accordingly.

  3. Start doh-proxy proxy dnsmasq to resolve

  4. HUAWEI CLOUD, add a trigger, close the verification (anyone can access), then copy the address to Chrome ‘s settings (Privacy and security -> Security -> Use secure DNS) , select Custom and fill in the address

  5. Turn on the translation function and use it happily (you can verify whether the resolution is successful in chrome://net-internals/?#dns )

code

dnsmasq configuration, change the address to your own

 port=5353 domain-needed strict-order cache-size=1024 address=/translate.google.com/123.123.123.123 address=/translate.googleapis.com/123.123.123.123

bootstrap is the startup file code of Huawei Cloud functions

 #!/bin/bash ## current dir cd $RUNTIME_CODE_ROOT ## start dnsmasq ./dnsmasq --conf-file=./dns.txt ## start doh-proxy ./doh-proxy --listen-address 0.0.0.0:8000 --server-address 127.0.0.1:5353

The rest of the binary files, I put them in the network disk, you can upload them directly on HUAWEI CLOUD, and then modify the address online, etc.

Quark Netdisk code.zip link

This article is reprinted from: https://dosk.win/2022/11/04/jie-jue-chrome-yuan-sheng-gu-ge-fan-yi-gong-nai-de-yi-ge-si-lu-3 -3/
This site is for inclusion only, and the copyright belongs to the original author.