Giter Site home page Giter Site logo

lelandlib / php-torcontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dunglas/php-torcontrol

0.0 2.0 0.0 396 KB

PHP TorControl, a library to control TOR

Home Page: http://dunglas.fr/2013/02/php-torcontrol-a-library-to-control-tor/

License: MIT License

PHP 100.00%

php-torcontrol's Introduction

PHP TorControl, a library to control TOR

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.

php-torcontrol's People

Contributors

amgine0 avatar dunglas avatar fabacab avatar instabledesign avatar mmerian avatar shoaibali avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.