2017 © Pedro Peláez
 

project spike

A fast reverse proxy that helps to expose your local services to the internet

image

slince/spike

A fast reverse proxy that helps to expose your local services to the internet

  • Friday, June 22, 2018
  • by slince
  • Repository
  • 22 Watchers
  • 382 Stars
  • 128 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 51 Forks
  • 2 Open issues
  • 6 Versions
  • 66 % Grown

The README.md

, (*1)

Software License Build Status Coverage Status Latest Stable Version Scrutinizer , (*2)

Spike is a fast reverse proxy built on top of ReactPHP that helps to expose your local services to the internet., (*3)

简体中文, (*4)

Installation

Install via composer, (*5)

composer global require slince/spike

Both the server and local machine need to install this., (*6)

Schematic diagram

, (*7)

Configure the server

A public machine that can be accessed on the internet is needed. Assuming already. There are two ways to start the server, (*8)

Based on defaults

Use the following command to start the server, (*9)

$ spiked --address=127.0.0.1:8088

The above command can create a basic service. If you want to customize more information, you should start the server based on the configuration file., (*10)

Based on the configuration file.

  • Creates a configuration file

Execute the following command to create it., (*11)

$ spiked init --dir=/home/conf --format=json

Yaml,Xml,Ini and Json(default) files are supported. Use the following command for help., (*12)

$ spiked init -h
  • Open the configuration file and modify the parameters., (*13)

  • Executes the following command to start the service., (*14)

 $ spiked --config=/home/conf/spiked.json

Configure the client.

You should first create a configuration file for the client., (*15)

  • Execute the following command to create it
$ spike init --dir=/home/conf --format=json

Use the following command for help about this command, (*16)

$ spike init -h
  • Open the configuration file and modify the parameters., (*17)

  • Start the client service., (*18)

$ spike --config=/home/conf/spike.json

Tunnel

The definition of the tunnel only in the client, the server does not need to do any configuration, so as to achieve the most simplified configuration., (*19)

Now supports both http and tcp tunnels, (*20)

Open the configuration file for the client and modify the parameters for "tunnel"., (*21)

  • Add an HTTP tunnel
{
    "protocol": "http",
    "serverPort": 8086,
    "proxyHosts": {
        "www.foo.com": "127.0.0.1:80",
        "www.bar.com": "192.168.1.101:8080"
    }
}

Restarts the client service. Visit "http://www.foo.com:8086", the service will be forwarded to the local "127.0.0.1:80"; Note that resolve "www.foo.com" to the server IP., (*22)

  • Add a TCP tunnel

The services based on the tcp can use the tunnel, such as: mysql, redis, ssh and so on; The following is an example of proxy mysql service, (*23)

{
    "protocol": "tcp",
    "serverPort": 8087,
    "host": "127.0.0.1:3306"
}

Execute the following command to visit the local mysql service., (*24)

$ mysql -h SERVER IP -P 8087

Client authentication

The authentication is not enabled on the server based on defaults.You should start the server based on configuration file, if you want to enable this., (*25)

  • Enable authentication

Open the configuration file for the server and modify parameters for "auth" and restart the service., (*26)

Currently only supports a simple user name password authentication, more authentication methods will be added later., (*27)

  • Modify the client identity information

Open the configuration file for the client and modify parameters for "auth". Keep the same parameters as the server., (*28)

Configure log

The default to open the console and file two forms of the log; the first will print the logs to the console; the second will write all the logs to the specified file; Default log level is "info"; You can adjust this in the configuration file., (*29)

List Commands

$ spike list
   _____   _____   _   _   _    _____
  /  ___/ |  _  \ | | | | / /  | ____|
  | |___  | |_| | | | | |/ /   | |__
  \___  \ |  ___/ | | | |\ \   |  __|
   ___| | | |     | | | | \ \  | |___
  /_____/ |_|     |_| |_|  \_\ |_____|

  Spike Client 0.0.1

  Usage:
    command [options] [arguments]

  Options:
    -h, --help            Display this help message
    -q, --quiet           Do not output any message
    -V, --version         Display this application version
        --ansi            Force ANSI output
        --no-ansi         Disable ANSI output
    -n, --no-interaction  Do not ask any interactive question
    -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

  Available commands:
    help        Displays help for a command
    init        Create a configuration file in the specified directory
    list        Lists commands
    list-proxy  Lists all supported proxy hosts by the client

Changelog

See CHANGELOG.md, (*30)

License

The MIT license. See MIT, (*31)

The Versions

22/06 2018

dev-master

9999999-dev

A fast reverse proxy that helps to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel

15/06 2018

0.1.0

0.1.0.0

A fast reverse proxy that helps to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel

13/06 2018

0.0.x-dev

0.0.9999999.9999999-dev

A fast reverse proxy that helps to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel

06/09 2017

1.0.0-beta3

1.0.0.0-beta3

A fast reverse proxy that helps to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel

04/07 2017

1.0.0-beta2

1.0.0.0-beta2

A fast reverse proxy that helps to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel

27/06 2017

1.0.0-beta1

1.0.0.0-beta1

A fast reverse proxy that help to expose your local services to the internet

  Sources   Download

MIT

The Requires

 

The Development Requires

by tao

proxy reactphp reverse proxy tcp tunnel tunnel nat expose localhost http tunnel