2017 © Pedro Peláez
 

library proxy

Implementation of the proxy protocol

image

samit/proxy

Implementation of the proxy protocol

  • Monday, August 22, 2016
  • by SamMousa
  • Repository
  • 1 Watchers
  • 1 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

php-proxy-protocol

Implementation of HAProxy v1 and v2, (*1)

Scrutinizer Code Quality Build Status Code Coverage, (*2)

Example of forwarding requests to NGINX

This example illustrates how to create a reverse proxy server that forwards all requests to an NGINX server., (*3)

Test script

<?php

include 'vendor/autoload.php';
use \React\SocketClient\TcpConnector;

/** @var \React\EventLoop\LoopInterface $loop */
$loop = \React\EventLoop\Factory::create();
$connector = new TcpConnector($loop);

/** @var \React\Socket\ServerInterface $servers */
$servers = [];

$server = $servers[] = new \React\Socket\Server($loop);
$server->listen(10000, '0.0.0.0');

$forwarder = new \SamIT\Proxy\Forwarder($connector);
$forwarder->on('forward', function(\React\Stream\ReadableStreamInterface $in,  \React\Stream\ReadableStreamInterface $out) {
    echo "Connection set up.\n";
});

$forwarder->forwardAll($server, '192.168.37.2', 8011, 1);
echo "Listening..\n";


$loop->run();
die("Done with loop\n");

Configuration for nginx:

server {
    listen 8011 proxy_protocol;

    set_real_ip_from 127.0.0.1/24;

    real_ip_header proxy_protocol;
    add_header Content-Type text/plain;
    return 200 "${remote_addr}:${remote_port}\n"; 
}

The Versions

22/08 2016

dev-master

9999999-dev

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

The Development Requires

22/08 2016

v0.5.0

0.5.0.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

The Development Requires

08/08 2016

v0.4.0

0.4.0.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

The Development Requires

29/07 2016

v0.3.0

0.3.0.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

29/07 2016

v0.2.3

0.2.3.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

29/07 2016

v0.2.2

0.2.2.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

29/07 2016

v0.2.1

0.2.1.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

29/07 2016

v0.2.0

0.2.0.0

Implementation of the proxy protocol

  Sources   Download

MIT

The Requires

 

29/09 2015

v0.1.0

0.1.0.0

Implementation of the proxy protocol

  Sources   Download

MIT