proxy.c ready for multithreading