Using fsockopen with UDP and proxy?

So, I was wondering (and testing) if I can use fsockopen with proxy and UDP traffic?

Give an example, for example:

$fp = fsockopen('udp://', 512, $errno, $errstr);
if(!$fp){ die($errno . ' - ' . $errstr); }


works ... but as soon as I add proxy

$proxy = " "; // proxy 
$port = 1080; // proxy port

$fp = fsockopen("udp://".$proxy, $port, $errno, $errstr);
if(!$fp){ die($errno . ' - ' . $errstr); }

// after connecting to proxy... connect to target...
fputs($fp, "CONNECT\r\n");


and try sending some data with fwrite read response using fread. I am not getting anything.

But without a proxy, everything works fine. I tried downloading public proxies but I was never able to get an answer ...

Any thoughts on this? Also I am starting to think "fputs ($ fp," CONNECT\r\n "); is not good for this ... or is it?


source to share

All Articles