Actual projects encountered in cross-domain requests

Problems encountered in cross-domain projects

1. Cross-Domain:

Refers to the browser can not execute scripts other sites, it is secure browser limitations

Cross-domain difference

1.非跨域请求
http://www.123.com/index调用http://www.123.com/userinfo
2.跨域请求
主域名不同
http://www.123.com/index调用http://www.321.com/userinfo
子域名不同
http://abc.123.com/index调用http://def.123.com/userinfo
端口不同
http://www.123.com:8000/index调用http://www.123.com:9000/server
协议不同
http://www.123.com:9000/index调用https://www.123.com:9000/server

Guess you like

Origin www.cnblogs.com/Zhao159461/p/11520050.html