src/server.js
/**
     * Handles incoming sockets, useful for error handling
     */
Handles incoming sockets, useful for error handling
Handles incoming sockets useful for error handling
onConnection(socket) {
        socket.on('error', (err) => {
            if (this.listenerCount('error') === 1) {
                this.log(handlerOpts.id, `Source socket emitted error: ${err.stack || err}`);
            }
        });
    }
onConnection ( socket ) { socket . on ( 'error' , ( err ) => { if ( this . listenerCount ( 'error' ) === 1 ) { this . log ( handlerOpts . id , ` ${ err . stack || err } ` ) ; } } ) ; }
Handles incoming sockets, useful for error handling
Handles incoming sockets useful for error handling
// We need to consume socket errors, otherwise they could crash the entire process. // See https://github.com/apify/proxy-chain/issues/53 // Handle errors only if there's no other handler