forkattu lähteestä coolaj86/goldilocks.js
		
	added some error event handlers
This commit is contained in:
		
							vanhempi
							
								
									e259c4d0ce
								
							
						
					
					
						commit
						be6900cd50
					
				@ -68,7 +68,13 @@ module.exports.create = function (deps, config) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function onError(err) {
 | 
			
		||||
      console.error('[error] socket errored peeking -', err);
 | 
			
		||||
      conn.destroy();
 | 
			
		||||
    }
 | 
			
		||||
    conn.once('error', onError);
 | 
			
		||||
    conn.once('data', function (chunk) {
 | 
			
		||||
      conn.removeListener('error', onError);
 | 
			
		||||
      peek(conn, chunk, opts);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -183,7 +183,7 @@ module.exports.create = function (deps, config, netHandler) {
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  var terminateServer = tls.createServer(terminatorOpts, function (socket) {
 | 
			
		||||
    console.log('(pre-terminated) tls connection, addr:', socket.remoteAddress);
 | 
			
		||||
    console.log('(post-terminated) tls connection, addr:', extractSocketProp(socket, 'remoteAddress'));
 | 
			
		||||
 | 
			
		||||
    netHandler(socket, {
 | 
			
		||||
      servername: socket.servername
 | 
			
		||||
@ -194,6 +194,9 @@ module.exports.create = function (deps, config, netHandler) {
 | 
			
		||||
    , remoteFamily:  extractSocketProp(socket, 'remoteFamily')
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
  terminateServer.on('error', function (err) {
 | 
			
		||||
    console.log('[error] TLS termination server', err);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  function proxy(socket, opts, mod) {
 | 
			
		||||
    var newConnOpts = require('../domain-utils').separatePort(mod.address || '');
 | 
			
		||||
 | 
			
		||||
		Ladataan…
	
	
			
			x
			
			
		
	
		Viittaa uudesa ongelmassa
	
	Block a user