master
cn.yimian.xyz 4 years ago
parent b98e77e641
commit 27fe2cb30e
  1. 17
      index.js
  2. 4
      src/index.js

@ -1,17 +0,0 @@
const express = require('express')
const request = require('request');
const app = express()
const port = 3000
app.listen(port, () => console.log(`Ushio-proxy listening at http://localhost:${port}`))
app.use(express.static(__dirname + '/public'));
app.get('/get/', (req, res) => {
if(req.query.hasOwnProperty('url')){
let web = request(new Buffer(req.query.url, 'base64').toString(), req.headers);
req.pipe(web);
web.pipe(res);
}
})

@ -9,7 +9,9 @@ app.use(express.static(__dirname + '/public'));
app.get('/get/', (req, res) => {
if(req.query.hasOwnProperty('url')){
request(new Buffer(req.query.url, 'base64').toString()).pipe(res);
let web = request(new Buffer(req.query.url, 'base64').toString(), req.headers);
req.pipe(web);
web.pipe(res);
}
})

Loading…
Cancel
Save