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 >
@sly Maybe you specified the wrong type of proxy (http/socks)? If it's really too bad, could you write down your proxy connection data so I can check it myself?