Fix Proxy issue

Bad cast and HTTPS bad debug