Jump to content

How to redirect uTorrent via HTTP headers?


StirolXXX

Recommended Posts

Posted

I changed my trackers announce url, and want to redirect utorrent clients to another url.

I made a sample code (PHP):

header("HTTP/1.0 302 OK");

header("Location: http://bt.mysite.com/announce.php\");

die;

But, when this is happening: utorrent does not append the GET parameters. I must redirect it by myself with all the parameters? BTW: this could be used against cheating ;)

Posted

You don't need the header("HTTP/1.0 302 OK");

The location header will handle it for you.

Apart from that, all you need is this:

$getstr='';

foreach($_GET as $x=>$y)

$getstr.='&'.urlencode($x).'='.urlencode($y);

$getstr=substr($getstr,1);

header('Location: http://site.com/announce2.php?'.$getstr);

exit();

I don't see how it could be used against cheats though.

Most cheats are either using uTorrent itself and modifying details, or using an http library which will follow redirects anyway. Only extremely primitive cheats will fail to follow the redirect. Even using the old firefox URL cheat will follow the redirect.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...