Proxy server was throwing errors on socket hangups (e.g. tab closed), causing the device process to die.

This commit is contained in:
Simo Kinnunen
2014-11-17 19:54:47 +09:00
parent 4ca5230402
commit 9447d72468

View File

@@ -87,12 +87,18 @@ module.exports = syrup.serial()
resolver.reject(err)
}
function ignore() {
// No-op
}
var proxy = httpProxy.createProxyServer({
target: url
, ws: false
, xfwd: false
})
proxy.on('error', ignore)
var proxyServer = http.createServer(function(req, res) {
proxy.web(req, res)
})