Base logic for UDP proxy (not tested)