https://github.com/essa/portwarp
port forwarding behind nat
https://github.com/essa/portwarp
Last synced: 4 months ago
JSON representation
port forwarding behind nat
- Host: GitHub
- URL: https://github.com/essa/portwarp
- Owner: essa
- Created: 2019-03-22T13:22:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-26T14:04:49.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T15:13:50.293Z (10 months ago)
- Language: Ruby
- Size: 48.8 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### What is this?
A tool for portforwarding via [piping-server](https://github.com/nwtgck/piping-server) inspired by following article.
- [Piping Server を介した双方向パイプによる,任意のネットワークコネクションの確立 \- Qiita](https://qiita.com/Cryolite/items/ed8fa237dd8eab54ef2f)
It is similar to port forwarding by `ssh -L` but source port and target port are connected through following servers.
- portwarp client
- piping-server
- portwarp serverYou can run portwarp server in a private network if it is reachable to piping-server via outbound connection.
### Usage
These examples assumes a piping server available for both client and server side, given as `http://piping.server/`.
server side
```
$ docker run --net=host -ti essa/portwarp portwarp http://piping.server/
I, [2019-03-24T13:36:14.547737 #1] INFO -- : portwarp start
I, [2019-03-24T13:36:14.547936 #1] INFO -- : server mode
I, [2019-03-24T13:36:14.589788 #1] INFO -- : server start url = http://piping.server/29ef18e25dddece9
````portwarp` server displays a url for client.
Please give it to client side of `portwarp`.client side
```
$ git clone https://github.com/essa/portwarp.git
$ cd portwarp
$ bundle
$ bundle exec bin/portwarp http://piping.server/29ef18e25dddece9 8080 private.server.local:80
```Then `localhost:8080` is connected to `private.server.local:80` and you can connect to it by giving `http://localhost:8080` to your local browser.
Or you can get the response directly by giving a command at the last of command line.
```
$ bundle exec bin/portwarp http://piping.server/29ef18e25dddece9 8080 private.server.local:80 curl http://localhost8080/
```Other example for client side
```
$ bundle exec bin/portwarp --loglevel=DEBUG http://piping.server/29ef18e25dddece9 1022 localhost:22 ssh -p 1022 ec2-user@localhost
```### ToDo
- [ ] notify error on server to client
- [ ] describe options on --help
- [ ] handling shell args and quotes
- [ ] automate docker push with CI### License
MIT