Watch 2 Star 1 Fork 0

netnr / proxyMIT

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
HTTP请求代理,CORS跨域请求,HTTPS支持(cors-anywhere) spread retract

https://proxy.netnr.com

Clone or download
README.md 991 Bytes
Copy Edit Web IDE Raw Blame History
netnr authored 2019-03-23 21:27 . update

proxy

HTTP请求代理,CORS跨域请求,HTTPS支持

作用

  • 支持跨域请求(转换不支持跨域请求的接口),可直接发起 ajax、fetch
  • 支持HTTPS(解决远程数据接口不支持HTTPS)

接口

使用

拷贝到控制台运行

fetch("https://proxy.zme.ink/https://www.google.com")
	.then(x => x.text())
	.then(function (data) {
		console.log(data);
	})

var $url = "http://wthrcdn.etouch.cn/weather_mini?citykey=101040100";
fetch("https://proxy.zme.ink/" + $url)
	.then(x => x.text())
	.then(function (data) {
		console.log(data);
	})

安装

  • npm install
  • node server.js

Fork

Source

Comment ( 0 )

You need to Sign in for post a comment

Help Search