Update proxy.js

Added host cache, sleep function