Update proxy.c

complete version... need further modifications