Ok, if you don't mind to use fsockopen, then this is a working solution :
I assume user want to go to
<? $ip = "1.2.3.4"; // proxy IP, change this according to your proxy setting in your IE or NS $port = 1234; // proxy port, change this according to your proxy setting in your IE or NS