Use file objects in proxy (to close the streams automatically).