Rewritten chproxy function and add reset-proxy function.