使用 node 创建代码服务器

var express = require('express');
var proxy = require('http-proxy-middleware');
var app = express();
app.use('/', proxy({ target: 'https://www.baidu.com/', changeOrigin: true }));
app.listen(3000);

访问 http://localhost:3000/ 就相当于访问百度了。

猜你喜欢

转载自www.cnblogs.com/daysme/p/9031880.html
今日推荐