PHPackages                             slince/spike - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. slince/spike

ActiveProject[HTTP &amp; Networking](/categories/http)

slince/spike
============

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

0.1.1(7y ago)671627117[5 issues](https://github.com/slince/spike/issues)MITPHPPHP &gt;=5.6.0

Since Jun 13Pushed 4y ago37 watchersCompare

[ Source](https://github.com/slince/spike)[ Packagist](https://packagist.org/packages/slince/spike)[ RSS](/packages/slince-spike/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (10)Versions (5)Used By (0)

 [![](https://raw.githubusercontent.com/slince/spike/master/resources/logo.png)](https://raw.githubusercontent.com/slince/spike/master/resources/logo.png)

 [ ![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265) ](LICENSE) [ ![Build Status](https://camo.githubusercontent.com/5dff0e15bb8bc6aaeb81337b10caf13bc4c9f2cf158112590d94cd330c7b27dc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f736c696e63652f7370696b652f6d61737465722e7376673f7374796c653d666c61742d737175617265) ](https://travis-ci.org/slince/spike) [ ![Coverage Status](https://camo.githubusercontent.com/26150e2df998940be643586e3a8c2a4ae37e0607a2b154b42f2fba04ccd9d241/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f736c696e63652f7370696b652e7376673f7374796c653d666c61742d737175617265) ](https://codecov.io/github/slince/spike) [ ![Latest Stable Version](https://camo.githubusercontent.com/66441885f90d0f1275b7e5b40836eed700ca9ed855945efda052f7337958f0dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c696e63652f7370696b652e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65) ](https://packagist.org/packages/slince/spike) [ ![Scrutinizer](https://camo.githubusercontent.com/b3817fe12e5ab072dfce77030c0ceb3bc1cd2a1ce7e44785641c5f7a7ea2fb9a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f736c696e63652f7370696b652e7376673f7374796c653d666c61742d737175617265) ](https://scrutinizer-ci.com/g/slince/spike/?branch=master)

Spike is a fast reverse proxy built on top of [ReactPHP](https://github.com/reactphp) that helps to expose your local services to the internet.

[简体中文](./README-zh_CN.md)

Installation
------------

[](#installation)

Install via composer

```
composer global require slince/spike
```

> Both the server and local machine need to install this.

Schematic diagram
-----------------

[](#schematic-diagram)

 [![](https://raw.githubusercontent.com/slince/spike/master/resources/diagram.png)](https://raw.githubusercontent.com/slince/spike/master/resources/diagram.png)

Configure the server
--------------------

[](#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

### Based on defaults

[](#based-on-defaults)

Use the following command to start the server

```
$ 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.

### Based on the configuration file.

[](#based-on-the-configuration-file)

- Creates a configuration file

Execute the following command to create it.

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

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

```
$ spiked init -h
```

- Open the configuration file and modify the parameters.
- Executes the following command to start the service.

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

Configure the client.
---------------------

[](#configure-the-client)

You should first create a configuration file for the client.

- Execute the following command to create it

```
$ spike init --dir=/home/conf --format=json
```

Use the following command for help about this command

```
$ spike init -h
```

- Open the configuration file and modify the parameters.
- Start the client service.

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

Tunnel
------

[](#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.

> Now supports both http and tcp tunnels

Open the configuration file for the client and modify the parameters for "tunnel".

- 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 "", the service will be forwarded to the local "127.0.0.1:80"; Note that resolve "[www.foo.com](http://www.foo.com)" to the server IP.

- 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

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

Execute the following command to visit the local mysql service.

```
$ mysql -h SERVER IP -P 8087
```

Client authentication
---------------------

[](#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.

- Enable authentication

Open the configuration file for the server and modify parameters for "auth" and restart the service.

> Currently only supports a simple user name password authentication, more authentication methods will be added later.

- Modify the client identity information

Open the configuration file for the client and modify parameters for "auth". Keep the same parameters as the server.

Configure log
-------------

[](#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.

List Commands
-------------

[](#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
---------

[](#changelog)

See [CHANGELOG.md](./CHANGELOG.md)

License
-------

[](#license)

The MIT license. See [MIT](https://opensource.org/licenses/MIT)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

3

Last Release

2818d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3785826?v=4)[Tao](/maintainers/slince)[@slince](https://github.com/slince)

---

Top Contributors

[![slince](https://avatars.githubusercontent.com/u/3785826?v=4)](https://github.com/slince "slince (48 commits)")

---

Tags

expose-localhosthttp-tunnelnatproxyreverse-proxyspiketcp-tunneltunnelproxyreactphptunneltcp tunnelreverse proxynatexpose localhosthttp tunnel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/slince-spike/health.svg)

```
[![Health](https://phpackages.com/badges/slince-spike/health.svg)](https://phpackages.com/packages/slince-spike)
```

###  Alternatives

[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[clue/http-proxy-react

Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP

472.3M33](/packages/clue-http-proxy-react)[clue/docker-react

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.

113154.9k1](/packages/clue-docker-react)[clue/socks-react

Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.

1171.1M33](/packages/clue-socks-react)[clue/soap-react

Simple, async SOAP webservice client library, built on top of ReactPHP

64118.0k1](/packages/clue-soap-react)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
