Javascript-How can foreign trade websites shield Chinese mainland ip addresses?

Source: Internet
Author: User
The foreign trade station does not want to allow access from mainland China. it wants to use JavaScript to detect that the browser language is blocked in Chinese, but it will mistakenly hurt many overseas Chinese. In addition, according to statistics, there are still many overseas Chinese websites, how can I solve this problem if I use backend PHP to determine whether to search for the Chinese mainland for half a day? Before and after... the foreign trade station does not want to allow access from mainland China. it wants to use JavaScript to detect that the browser language is blocked in Chinese, but it will mistakenly hurt many overseas Chinese. In addition, according to statistics, there are still many overseas Chinese websites, how can I solve this problem if I use backend PHP to determine whether to search for the Chinese mainland for half a day? Both frontend and backend

Reply content:

The foreign trade station does not want to allow access from mainland China. it wants to use JavaScript to detect that the browser language is blocked in Chinese, but it will mistakenly hurt many overseas Chinese. In addition, according to statistics, there are still many overseas Chinese websites, how can I solve this problem if I use backend PHP to determine whether to search for the Chinese mainland for half a day? Both frontend and backend

To shield IP addresses, you need to find IP addresses in mainland China. While the Asia Pacific region IP is the responsibility of the APNIC, you can download: http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest

Then, find the IP address in mainland China based on the country code "CN.

You can execute the following in shell:

Wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latestgrep ipv4 delegated-apnic-latest | grep CN | awk-f' | ''{print $4 }'

The output is the IP address of the Chinese mainland.

How do you shield me from the wall ......

PS: I don't want them to see how unrealistic they are, so I don't want them to buy it, for example, ban's registered email address, mobile phone number, and mailing address.

Check the access IP address. if it is a domestic IP address, it will be blocked.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.