lib/proxy.js
function (callbackFn) {
            var self = this;
            request.post(this.options.hostAndPort + '/phantom/functions/exit', {
                    form:{
                    }
                },
                function (error, response, body) {

                    if (response && response.statusCode === 200) {    //server up
                        self.server.close();
                        callbackFn && callbackFn.call(self, true);
                    }
                    else {    //server down
                        callbackFn.call(self, false);
                    }
                });
        }
function (callbackFn) {
            var self = this;
            request.post(this.options.hostAndPort + '/phantom/functions/exit', {
                    form:{
                    }
                },
                function (error, response, body) {

                    if (response && response.statusCode === 200) {    //server up
                        self.server.close();
                        callbackFn && callbackFn.call(self, true);
                    }
                    else {    //server down
                        callbackFn.call(self, false);
                    }
                });
        }
function ( callbackFn ) { var self = this ; request . post ( this . options . hostAndPort + '/phantom/functions/exit' , { form : { } } , function ( error , response , body ) { if ( response && response . statusCode === 200 ) { //server up self . server . close ( ) ; callbackFn && callbackFn . call ( self , true ) ; } else { //server down callbackFn . call ( self , false ) ; } } ) ; }
terminates phantomjs process
terminates phantomjs process