I am developing an Application Layer Protocol for which I need every HTTP request or response to route through a separate process running on localhost. As soon as someone enters a http url in a browser, the request should first pass to that process and then the process sends it to the required access point. Is it possible to build something like that?
It sounds like what you're looking for is a Transparent Proxy
It might be worth making your own HTTP request function that routes everything through the proxy without your code needing to know
Something like
function makeGetRequest(url){
$.post('http://localhost:PROXYPORT/get', { body: url })
}