HTTP Debugger Console Application (Beta Preview)


HTTP Debugger Console is a small, portable application that allows do debug HTTP traffic from a console application by using JavaScript.
For more samples see scripts/ directory in the downloaded zip file.

Print Url, Application and Status code:

httpEngine.addListener('request', function (connection, request) {
   console.log(connection.url);
   console.log(connection.application + ' (pid: ' + connection.processId + ')');
   console.log(connection.sessionId);  
   return request;
});

httpEngine.addListener('response', function (connection, request, response) {
   console.log(response.status);
   console.log(connection.sessionId);
   return response;
});
	

Respond with 503 status code to all requests:

httpEngine.addListener('request', function (connection, request) {
   console.log('respond to: ' + request.url);

   var header = 'HTTP/1.1 503 Service Unavailable';
   var content = '<html><head><title>503 Service Unavailable</title></head><body><h1>503 Service Unavailable</h1><h2>Reply by HTTP Console</h2></body></html>';

   return new httpEngine.httpResponse(header, content);
});
	
Please subscribe to our newsletter to be notified when Node.js and PowerShell modules are ready.