move proxy connection into its own module