proxy factory function instead doing in psgi