Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 1 | const httpProxy = require('http-proxy'); |
2 | |||||
3 | const proxy = httpProxy.createProxyServer({ | ||||
4 | target: 'http://xos.dev:9101' | ||||
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; |