Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpxxn/plumber
simple tunnel for expose localhost http and ssh server.
https://github.com/lpxxn/plumber
Last synced: 9 days ago
JSON representation
simple tunnel for expose localhost http and ssh server.
- Host: GitHub
- URL: https://github.com/lpxxn/plumber
- Owner: lpxxn
- License: gpl-3.0
- Created: 2023-03-13T14:56:57.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-02T15:47:46.000Z (over 1 year ago)
- Last Synced: 2024-06-21T06:32:24.550Z (5 months ago)
- Language: Go
- Homepage:
- Size: 12.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
`plumber` is a tunnel for expose localhost http and ssh server.
## install
```
git clone [email protected]:lpxxn/plumber.git
cd plumber
make install
```
## quick start## http tunnel
`Plumber` can forward HTTP request to a specified local service, and can also forward different requests to different services through configuration. For example, forward `/api/v1/user` to `Srv1` and forward all requests of `/query/*` to `Srv2`. It also supports parameter forwarding, such as forwarding `/order/:orderID` to `Srv3`
eg:
server config:
```yaml
tcpAddr: :9870httpProxy:
- domain: lpxxn.com
port: 9190
defaultForwardTo: lpxxn # forward to client which uuid is lpxxn
forwards: # if forwards is empty, then all requests will be forwarded to defaultForwardTo
- path: /api/*
forwardTo: abc # forward to abc server
- path: /order/:orderNO
forwardTo: http://127.0.0.1:7632 # if forwardTo is not empty, then forward to the server which name is forwardTo```
`plumber -config ./config/testdata/srv.yaml`client config1:
```yaml
srvTcpAddr: 127.0.0.1:9870
http:
remotePort: 9190 # remote port, same as server config port
uid: lpxxn
localSrvAddr: 127.0.0.1:7654
```
`plumber-cli -config ./config/testdata/cli-http-proxy.yaml`
client config2:
```yaml
srvTcpAddr: 127.0.0.1:9870
http:
remotePort: 9190 # remote port, same as server config port
uid: abc
localSrvAddr: 127.0.0.1:7632```
`plumber-cli -config ./config/testdata/cli-http-proxy2.yaml`send curl request:
```shell
curl http://lpxxn.com:9190/api/v1/user
curl http://lpxxn.com:9190/abc
curl http://lpxxn.com:9190/order/123
```
## ssh tunnel
you can expose your local ssh server to the public network through `Plumber`, and support multiple users.
server config:
```yaml
tcpAddr: :9870```
run `plumber -config ./config/testdata/srv-ssh.yaml`
client config1:
```yaml
srvTcpAddr: 127.0.0.1:9870 # plumber server addr
ssh:
srvPort: 7222 # ssh remote server port
localSSHAddr: 127.0.0.1:7655 # local ssh server ad dr```
run `plumber-cli -config ./config/testdata/cli.yaml`