pump-io / pump.io

Social server with an ActivityStreams API
http://pump.io/
Apache License 2.0
2.22k stars 333 forks source link

cdnjs blocked in China #837

Open Hao-Wu opened 11 years ago

Hao-Wu commented 11 years ago

Hi, There seems to be some problem when loading resources from the CDN network https://cdnjs.cloudflare.com/* , which blocks the UI and functions of these 2 sites.

I know this is not caused by pump.io framework. But the demo sites is very important for pump.io. The followings are the errors in Chrome console.

Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/file-uploader/3.1.1/fineuploader.css
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/select2/3.4.1/select2.min.css
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/json2/20121008/json2.min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/spin.js/1.2.7/spin.min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/file-uploader/3.1.1/jquery.fineuploader.min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/wysihtml5/0.3.0/wysihtml5.min.js
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/select2/3.4.1/select2.min.js
Uncaught TypeError: Cannot set property 'sync' of undefined model.js:23
Uncaught TypeError: Cannot read property 'Router' of undefined router.js:21
Failed to load resource https://cdnjs.cloudflare.com/ajax/libs/sockjs-client/0.3.2/sockjs-min.js
Uncaught TypeError: Cannot read property 'View' of undefined view.js:39
Uncaught ReferenceError: _ is not defined e14n.com/:168
Uncaught TypeError: undefined is not a function pump.js:37
evanp commented 11 years ago

Which browser? These are working fine for me. Do you have some kind of blocking software installed?

Hao-Wu commented 11 years ago

Hi Evan, you are right. If I switch my connection to VPN hosted in North America, all the static library resources in cdnjs can be loaded very fast.

After Googling for a while, I find it is a common issue for developers in China. Maybe CDNJS.com is not so optimized for its Asia nodes.

The workaround for me is to replace all the https://cdnjs.cloudflare.com/* files with some other similar service, e.g. https://github.com/staticfile/static.

I hope this could do some help for those with similar problem, Thank you.

evanp commented 11 years ago

I've brought it up with cdnjs/cdnjs and we'll see if there's a resolution.

I'm also going to look into other CDNs for backup.

Hao-Wu commented 11 years ago

Thanks for bringing the issue up to cdnjs project. It seems that all the libraries with "https://" are blocked by the Great Firewall. But when I tested them with "http://", everything is fine, and loaded very fast. The FIREWALL is becoming smarter. Not only keywords and hosts IP, but also those protocols e.g. SSH, GIT, HTTPS can be detected and blocked according to some policy.

is it possible to use the http version of these js libraries? Any security concern?

relay-zz commented 10 years ago

"cdnjs.cloudflare.com" under HTTP is blocked too in China. Not only HTTPS. If I switch to Google's DNS server, then the CDN works again.

bardiharborow commented 10 years ago

Not sure if this issue is still relevant, but accoring to greatfirewallofchina.org, cdnjs is still blocked in China.

strugee commented 8 years ago

We want to get 0.3.1 out fast and this requires complex external stuff. Pushing to 0.4.0