new version with proxy support