split NetProxy class into client and server, modify the codes accordingly.