Fix bugs in proxy feature and add proxy to demo.