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
index.html 3.74 KB
Copy Edit Web IDE Raw Blame History
netnr authored 2019-03-23 21:27 . update
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link href="favicon.svg" rel="Shortcut Icon" type="image/svg" />
<meta name="keywords" content="netnr,NET牛人,proxy,cors,HTTPS跨域代理" />
<meta name="description" content="netnr,NET牛人,proxy,cors,HTTPS跨域代理" />
<title>proxy</title>
<link href="https://lib.baomitu.com/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="https://lib.baomitu.com/github-markdown-css/3.0.1/github-markdown.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12 my-4 markdown-body">
<h1>proxy</h1>
<blockquote>
<p>HTTP请求代理,CORS跨域请求,HTTPS支持</p>
</blockquote>
<h3>作用</h3>
<ul>
<li>支持跨域请求(转换不支持跨域请求的接口),可直接发起 ajax、fetch</li>
<li>支持HTTPS(解决远程数据接口不支持HTTPS)</li>
</ul>
<h3>接口</h3>
<ul>
<li><a href="https://proxy.zme.ink/$url">https://proxy.zme.ink/$url</a></li>
</ul>
<h3>使用</h3>
<ul>
<li><a href="https://proxy.zme.ink/https://api.github.com">https://proxy.zme.ink/https://api.github.com</a></li>
<li><a href="https://proxy.zme.ink/https://www.google.com">https://proxy.zme.ink/https://www.google.com</a></li>
<li><a href="https://proxy.zme.ink/http://nginx.org/download/nginx-1.14.2.tar.gz">https://proxy.zme.ink/http://nginx.org/download/nginx-1.14.2.tar.gz</a></li>
</ul>
<blockquote>
<p>拷贝到控制台运行</p>
</blockquote>
<pre><code>fetch(<span class="hljs-string">"https://proxy.zme.ink/https://www.google.com"</span>)
.then(<span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> x.text())
.then(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>) </span>{
<span class="hljs-built_in">console</span>.log(data);
})
</code></pre>
<hr>
<pre><code><span class="hljs-keyword">var</span> $url = <span class="hljs-string">"http://wthrcdn.etouch.cn/weather_mini?citykey=101040100"</span>;
fetch(<span class="hljs-string">"https://proxy.zme.ink/"</span> + $url)
.then(<span class="hljs-function"><span class="hljs-params">x</span> =&gt;</span> x.text())
.then(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">data</span>) </span>{
<span class="hljs-built_in">console</span>.log(data);
})
</code></pre>
<h3>安装</h3>
<ul>
<li><code>npm install</code></li>
<li><code>node server.js</code></li>
</ul>
<h3>Fork</h3>
<ul>
<li><a href="https://github.com/Rob--W/cors-anywhere">https://github.com/Rob--W/cors-anywhere</a></li>
</ul>
<h3>Source</h3>
<ul>
<li><a href="https://github.com/netnr/proxy">https://github.com/netnr/proxy</a></li>
<li><a href="https://gitee.com/netnr/proxy">https://gitee.com/netnr/proxy</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>

Comment ( 0 )

You need to Sign in for post a comment

Help Search