autoproxy for connect method
refactor