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 | |
Matteo Scandolo | 98b5f5d | 2017-03-17 17:09:05 -0700 | [diff] [blame] | 7 | const extensionsProxy = httpProxy.createProxyServer({ |
| 8 | target: 'http://192.168.46.100/spa/' |
| 9 | }); |
| 10 | |
Matteo Scandolo | c80ccbd | 2017-02-27 16:24:33 -0800 | [diff] [blame] | 11 | proxy.on('error', function(error, req, res) { |
| 12 | res.writeHead(500, { |
| 13 | 'Content-Type': 'text/plain' |
| 14 | }); |
| 15 | console.error('[Proxy]', error); |
| 16 | }); |
| 17 | |
Matteo Scandolo | 98b5f5d | 2017-03-17 17:09:05 -0700 | [diff] [blame] | 18 | module.exports = { |
| 19 | proxy, |
| 20 | extensionsProxy |
| 21 | }; |