build in the proxy middleware