For your second question read this post from @Fox ,
maybe its what you need. Its in Russian, but you can
use translator. There is an example script too >
Not that I know of. You'll need to tunnel through the proxy to really check the connection. I either do a proxy checker site to make sure nothing is leaking, or I just do the simple GET request against the site(s) I'm working with/on.