Ensure proxy middleware is called only once