whistle.nohost
Version:
Nohost plugin for whistle
12 lines (10 loc) • 373 B
JavaScript
const { transformWhistle } = require('../../util');
const initNetwork = require('../network');
module.exports = async (ctx) => {
const { req } = ctx;
req.url = req.url.replace('/network', '');
req.headers.host = 'local.wproxy.org';
req.headers['x-forwarded-for'] = ctx.ip || '127.0.0.1';
const port = await initNetwork();
await transformWhistle(ctx, port);
};