Add proxy support 

from develop branch
commit 1fe7a79f0aea211201a218db6ff8e34204113738