3

I need to optimize an Angular 4 website that use Azure as a database services. It seems that when the site is open from China, "The Great Firewall" is blocking all loading libraries and services as Google Search, Google Maps,Facebook services and APIs, SmartLook, Intercom and etc. Even the azurewebsites.net is blocked so no dynamic info can be loaded. What is the best appropriate way to make a website version for China? Any suggestions?

Here is a little log that is returned when trying to load the website from China:

sdk.js Failed to load resource: net::ERR_CONNECTION_REFUSED js Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR connect.facebook.net/en_US/fbevents.js Failed to load resource: net::ERR_CONNECTION_REFUSED vendor.987e75786c79d833ce36.bundle.js:1 ERROR Error: Uncaught (in promise): ReferenceError: FB is not defined

The same error is returned for every external service or library that the Client side try to load.

Ali Azam
  • 2,047
  • 1
  • 16
  • 25
Ognyan
  • 103
  • 1
  • 5
  • China has no Internet so it's kind of useless to try and make a website for it. You already answered your own question, everything you're trying to use on the site is blocked, you could catch any failures and ignore them (disable the feature). – HMR Feb 01 '18 at 16:11
  • Okay, but even azurewebsites.net is not accessible, so I cannot load any data. – Ognyan Feb 01 '18 at 16:16
  • Why should it work, don't you need Internet in order for it to work? I'm sure Microsoft can offer some local product for China but you probably need to connect to a special server on the China Intranet. – HMR Feb 01 '18 at 16:22
  • I understand. My last question is why some domain like example.com is accessible and subdomain.example.com (API for example) is not? – Ognyan Feb 01 '18 at 16:49
  • When I was in China I experienced that it really has no Internet. NPM doesn't work and some site work one day but not the other, they work in the morning but not in the afternoon. Some is due to government and some just by bad maintenance, the dns services in China are not very good. Then there is a problem of how you're going to make money. As soon as your service takes off your site will be blocked and copied, just ask youtube, facebook, uber and any other foreign company that got popular and got their service blocked for "security" only for a copy to immediately appear. – HMR Feb 01 '18 at 16:54
  • I also heard that many foreign services just block request from China out of hand due to the many attacks coming from there. There is no way of stopping the attacker other then just giving up on the market and blocking the country. – HMR Feb 01 '18 at 16:56
  • Yes, I understand this, but my domain is working, and the subdomain with the API is not, which is a little strange and I cannot technical explain it. – Ognyan Feb 01 '18 at 17:09
  • 1
    What are the ip addresses of domain and sub domain? google.com and mail.google.com have different ip addresses so maybe dns is not working from China, ip address is blocked, server refuses service from China or some other reason. If you want to target China it's best to host on China Intranet. – HMR Feb 01 '18 at 17:13
  • Thank you for all the answers! Best Regards! – Ognyan Feb 01 '18 at 17:17

1 Answers1

7

I'm a developer in China and I can say that the only reliable way to load a website in China is to host it in China and to host all dependencies that your application has in China as well. If you use a service that is blocked in China (facebook, Maps, Search, etc.) forget about them. They will not be usable in China. There is no way around it. Only people using a VPN will be able to access your service.

For everything that is a library you want to embed there is:

For hosting I'd also recommend using a chinese hoster, but be aware that you are required to acquire a license in order to host a server in china, possibly you will be required to register a company there. If you need to host outside china, choose a server from a nearby country (korea, japan work well)

Its not easy building a service in china, thats one of the reasons almost all service providers have a seperate entity for their services in mainland china.

Qiong Wu
  • 1,504
  • 1
  • 15
  • 27