PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Yousaf Syed   PHP Proxy Server   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Proxy Server
Forward HTTP requests to destination servers
Author: By
Last change: Update README.md
Update README.md
Update README.md
Update README.md
Date: 8 years ago
Size: 1,234 bytes
 

Contents

Class file image Download

standalone_php_proxy

Standalone proxy server in PHP sockets, I am using Guzzle to route the requests. Idea was if I can make HTTP Proxy Server in php to get more control over proxy and custom logic. Currently it only supports http requests you can choose port of your own choice plus if you want to make it public or private. This is a standard HTTP Proxy so you can use in browser. By default its only working for localhost, but you can allow public ip's.

Todo

  1. ~~Package availble via composer~~
  2. Easy way to integrate custom Logic
  3. Support HTTPs
  4. ~~Parse FormData~~

How To Install?

Define package in your composer.json file as require dependency

   "require": {
        "yousafsyed/standalone_php_proxy": "^v1.0"
    }

Now update/install composer dependencies

   $ composer install
   $ composer update

Example

Create a file server.php

   require "./vendor/autoload.php";
   use YousafSyed\ProxyServer;
   $server = new ProxyServer(); // optional parameters for port and host like this new ProxyServer('8080','localhost')
   // finally run the server
   $server->run();

How to Run?

$ php server.php

ScreenShot

ScreenShot