#说明:
- google的公共库国内访问不稳定
- 与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。
##百度公共库
- [地址](http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs)
- 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库
- 如果对版本要求不严,百度的公共库的确提供了一个很好的解决方案,不管从速度和稳定性方面都不错
- 百度CDN最明显的优势就是速度快
首先你需要一个不怕dns污染的http代理,比如连接到私人VPS的ssh tunnel+privoxy之类… | |
以下例子里我都使用10.8.0.1:8118作为代理服务器。 | |
## 让普通命令行工具使用代理 | |
可以在~/.profile或~/.bashrc里加上: | |
``` | |
enable_proxy() { | |
export http_proxy="10.8.0.1:8118" |
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST="$1" | |
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'` | |
#IP Addresses or hostnames are fine here | |
CAS_HOSTNAME=team.eea.sk | |
#Authentication details. This script only supports username/password login, but curl can handle certificate login if required | |
USERNAME=$2 |
#!/bin/sh | |
#set -x | |
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST=https://myapp.example.com/ | |
SP=https://myapp.example.com/index.php | |
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok" |
#说明:
##百度公共库