extension/proxy.js
function (e, req, res, host) {
		LOG.error('proxy error for host: ' + host + '. remove from active proxy list:', 'SR.Proxy');
		LOG.error(e, 'SR.Proxy');
		
		// remove proxy info from list
		delete l_proxies[host];
		
		// notify for proxy failure
		UTIL.safeCall(onProxyFail, host);
		
		// send back to client about the proxy error
		res.writeHead(502, {
   			'Content-Type': 'text/plain'
		});
		res.end('PROXY_ERROR: cannot access proxy: ' + host);		
	}
function (e, req, res, host) {
		LOG.error('proxy error for host: ' + host + '. remove from active proxy list:', 'SR.Proxy');
		LOG.error(e, 'SR.Proxy');
		
		// remove proxy info from list
		delete l_proxies[host];
		
		// notify for proxy failure
		UTIL.safeCall(onProxyFail, host);
		
		// send back to client about the proxy error
		res.writeHead(502, {
   			'Content-Type': 'text/plain'
		});
		res.end('PROXY_ERROR: cannot access proxy: ' + host);		
	}
function ( e , req , res , host ) { LOG . error ( 'proxy error for host: ' + host + '. remove from active proxy list:' , 'SR.Proxy' ) ; LOG . error ( e , 'SR.Proxy' ) ; // remove proxy info from list delete l_proxies [ host ] ; // notify for proxy failure UTIL . safeCall ( onProxyFail , host ) ; // send back to client about the proxy error res . writeHead ( 502 , { 'Content-Type' : 'text/plain' } ) ; res . end ( 'PROXY_ERROR: cannot access proxy: ' + host ) ; }
same error handling for both HTTP or WebSocket proxies
same error handling for both HTTP or WebSocket proxies