Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 1 | const httpProxy = require('http-proxy'); |
2 | |||||
3 | const proxy = httpProxy.createProxyServer({ | ||||
Matteo Scandolo | 042ea63 | 2017-03-01 19:02:34 -0800 | [diff] [blame] | 4 | target: 'http://192.168.46.100:9101' |
Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 5 | }); |
6 | |||||
7 | proxy.on('error', function(error, req, res) { | ||||
8 | res.writeHead(500, { | ||||
9 | 'Content-Type': 'text/plain' | ||||
10 | }); | ||||
11 | console.error('[Proxy]', error); | ||||
12 | }); | ||||
13 | |||||
14 | module.exports = proxy; |