Git Product home page Git Product logo

forwarder's Introduction

PHP Forwarder

A pure PHP based TCP & UDP forwarder with Web interface.

Config

Authenticate

Find following block at master.php

define('USERNAME','admin');
define('PASSWORD','asdasd');

Web Interface Listen Address And Port

Find following block at master.php

$webserver = new WebServer('http://0.0.0.0:18512');

PHP-CLI Path

If you are install the service manually, You probably need to set the php path

define('PHPCLI','php');

Usage

Web Interface

I think you know how to use it.

Command Line

Start the service

    php master.php start

Start the service as DEAMON

    php master.php start -d

Restart the service as DEAMON

    php master.php restart -d

Stop the service for DEAMON

    php master.php stop

Install

CentOS 6 ( OneKey )

    yum install -y epel-release
    rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    yum remove -y libevent-devel
    yum install php71w-cli php71w-process git gcc php71w-devel php71w-pear php71w-pdo libevent2-devel -y
    echo -e "\n\n\n\n\nno\nyes\n" | pecl install event
    echo extension=event.so >> /etc/php.d/sockets.ini
    git clone https://github.com/linkec/forwarder
    cd forwarder
    php master start -d

CentOS 6 ( Detail )

    #Install epel RPM source
    yum install -y epel-release

    #Install webtatic RPM source
    rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

    #Remove Old Version Libevent Development Package
    yum remove libevent-devel

    #Install PHP7 & Libevent From RPM
    yum install php71w-cli php71w-process git gcc php71w-devel php71w-pear php71w-pdo libevent2-devel

    #Install PHP event Extension
    #ATTENTION: Please Enter 'no' When you see "Include libevent OpenSSL support [yes] :"
    #ATTENTION: Please Enter 'yes' When you see "PHP Namespace for all Event classes :"
    pecl install event

    #Active Extension
    echo extension=event.so >> /etc/php.d/sockets.ini

    #Download Forwarder
    git clone https://github.com/linkec/forwarder
    cd forwarder

    #Start Forwarder as deamon
    php master start -d

CentOS 7 ( OneKey )

    yum install -y epel-release
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    yum install php71w-cli php71w-process git gcc php71w-devel php71w-pear php71w-pdo libevent-devel -y
    echo -e "\n\n\n\n\nno\nyes\n" | pecl install event
    echo extension=event.so >> /etc/php.d/sockets.ini
    git clone https://github.com/linkec/forwarder
    cd forwarder
    php master start -d

CentOS 7 ( Detail )

    #Install epel RPM source
    yum install -y epel-release

    #Install webtatic RPM source
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

    #Install PHP7 & Libevent From RPM
    yum install php71w-cli php71w-process git gcc php71w-devel php71w-pear php71w-pdo libevent-devel

    #Install PHP event Extension
    #ATTENTION: Please Enter 'no' When you see "Include libevent OpenSSL support [yes] :"
    #ATTENTION: Please Enter 'yes' When you see "PHP Namespace for all Event classes :"
    pecl install event

    #Active Extension
    echo extension=event.so >> /etc/php.d/sockets.ini

    #Download Forwarder
    git clone https://github.com/linkec/forwarder
    cd forwarder

    #Start Forwarder as deamon
    php master start -d

forwarder's People

Contributors

linkec avatar

Watchers

 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.