PHP code example of mosquitood / proxy

1. Go to this page and download the library: Download mosquitood/proxy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mosquitood / proxy example snippets


   
  uitood\Proxy\Tcp;
  $proxy = new Tcp();
  $proxy->setHost("0.0.0.0")
      ->setPort(9494)
      ->setOptions([
          'worker_num' => 8, 
          'buffer_output_size' => 32*1024*1024,
          'daemonize'  => 0,
          'log_file'   => "/tmp/tcpproxy.txt"
      ])
      ->setDBConf([
          "host" => 'localhost',
          'port' => 3306,
          'user' => 'root',
          'password' => 'password',
          'database' => 'name',
          'charset'  => 'utf8',
      ]);
  $proxy->start();