title: Reverse proxy with additional logic using CherryPy
body: <p>Is it possible to run a CherryPy application as a reverse proxy, to intercept ALL requests and rewrite them depending on the URL and other logic?</p>
  
  <p>My aims:</p>
  
  <ul>
  <li>intercept all requests and perform home-rolled authentication</li>
  <li>rewrite the requests to different services (perhaps on different ports) depending on the URL</li>
  <li>return the result</li>
  </ul>
  
  <p>All the examples I find refer to putting CherryPy behind a reverse proxy like Apache.</p>
  
  <p>I would imagine there's a hook function that can be overridden</p>
  
  <p>I've looked the <a href="http://www.decalage.info/python/cherryproxy" rel="nofollow noreferrer">CherryProxy</a> package, but the documentation is sparse, and it looks like it's just using CherryPy hooks anyway.</p>