定制 dunglas/php-torcontrol 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dunglas/php-torcontrol

最新稳定版本:v1.0.1

Composer 安装命令:

composer require dunglas/php-torcontrol

包简介

Tor control library

关键字:

README 文档

README

TorControl is a PHP library to control a Tor server.

Build Status SensioLabsInsight StyleCI

Features

  • Connect to a Tor server through network socket, SSL network socket or UNIX socket
  • Support null, password and cookie file authentication methods
  • Automatic authentication for null and cookie file methods
  • Multi-line replies
  • Unit-tested with PHPUnit
  • Installation with Composer

Installation

Note: if you use the Symfony framework, you should use DunglasTorControlBundle.

If not already done, install Composer.

Add php-torcontrol to your composer.json:

composer require dunglas/php-torcontrol

Usage

<?php

// Autoloading using composer
require 'vendor/autoload.php';

// Connect to the TOR server using password authentication
$tc = new TorControl\TorControl(
    array(
        'hostname' => 'localhost',
        'port'     => 9051,
        'password' => 'MySecr3tPassw0rd',
        'authmethod' => 1
    )
);

$tc->connect();

$tc->authenticate();

// Renew identity
$res = $tc->executeCommand('SIGNAL NEWNYM');

// Echo the server reply code and message
echo $res[0]['code'].': '.$res[0]['message'];

// Quit
$tc->quit();

Related

Credits

PHP TorControl has been created by Kévin Dunglas.

统计信息

  • 总下载量: 5.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 89
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 88
  • Watchers: 8
  • Forks: 19
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-02-23