我正在將tor集成到我的Delphi應用程序中;整個故事is explained in this link將PHP代碼移植到Delphi代碼
後,我在網上搜索,然後我找到了一個代碼,在PHP
function tor_new_identity($tor_ip='127.0.0.1', $control_port='9051', $auth_code=''){
$fp = fsockopen($tor_ip, $control_port, $errno, $errstr, 30);
if (!$fp) return false; //can't connect to the control port
fputs($fp, "AUTHENTICATE $auth_code\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') return false; //authentication failed
//send the request to for new identity
fputs($fp, "signal NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') return false; //signal failed
fclose($fp);
return true;
}
切換新身份的任何一個可以幫助我端起這德爾福/帕斯卡爾
我不知道任何PHP基礎知識提前
感謝
問候
你的CheckOK有一個明顯的錯誤:它被聲明爲Integer,但是'Result'類型(和它在TorNewIdentity中被調用的類型)是一個布爾表達式。 – 2010-10-22 20:37:18
+1因爲_因爲我無法阻止自己_:D – jachguate 2010-10-22 21:20:57
@梅森爲我寫了一個文本編輯器。謝謝! – 2010-10-23 06:54:59