proxy: move code to dlib/proxy