Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kintoandar/fwd
🚂 The little forwarder that could
https://github.com/kintoandar/fwd
cli fwd golang network ngrok security utility
Last synced: 3 months ago
JSON representation
🚂 The little forwarder that could
- Host: GitHub
- URL: https://github.com/kintoandar/fwd
- Owner: kintoandar
- License: mit
- Created: 2016-08-28T11:55:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-17T14:26:55.000Z (over 3 years ago)
- Last Synced: 2024-08-02T02:15:04.655Z (6 months ago)
- Topics: cli, fwd, golang, network, ngrok, security, utility
- Language: Go
- Homepage: https://blog.kintoandar.com/2016/08/fwd-the-little-forwarder-that-could.html
- Size: 468 KB
- Stars: 210
- Watchers: 5
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - fwd - 🚂 The little forwarder that could (Go)
README
Table of Contents
=================* [Table of Contents](#table-of-contents)
* [fwd \- The little forwarder that could](#fwd---the-little-forwarder-that-could)
* [About](#about)
* [Use Cases](#use-cases)
* [fwd ♥️ ngrok](#fwd-%EF%B8%8F-ngrok)
* [Simple Use Case](#simple-use-case)
* [Install](#install)
* [Binary Releases](#binary-releases)
* [Go Tool](#go-tool)
* [Usage](#usage)
* [Credits](#credits)# fwd - The little forwarder that could
[![Travis](https://img.shields.io/travis/kintoandar/fwd.svg)](https://travis-ci.org/kintoandar/fwd)## About
`fwd` is a network port forwarder written in golang.It's cross platform, supports multiple architectures and it's dead simple to use.
Read all about it in this [article](https://blog.kintoandar.com/2016/08/fwd-the-little-forwarder-that-could.html).
## Use Cases
### fwd ♥️ ngrok
I must admit `ngrok` was an huge inspiration for `fwd`. If you don't know the tool you should definitely check out [this talk](https://www.youtube.com/watch?v=F_xNOVY96Ng) from [@inconshreveable](https://twitter.com/inconshreveable).This tool combo (fwd + ngrok) allows some wicked mischief, like taking [firewall hole punching](https://en.wikipedia.org/wiki/Hole_punching_(networking)) to another level! And the setup is trivial.
`ngrok` allows to expose a local port on a public endpoint and `fwd` allows to connect a local port to a remote endpoint. You see where I'm heading with this... With both tools you can connect a public endpoint to a remote port as long as you have access to it.
Here's how it works:
```
+---------+ +---------+
:9000 | | 172.28.128.3:22 | |
Internet +------------------> | fwd | +------------------------> | ssh |
tcp.ngrok.io:1234 | | 172.28.128.1 | |
+---------+ +---------+
``````
# get a public endpoint, ex: tcp.ngrok.io:1234
ngrok tcp 9000# forward connections on :9000 to 172.28.128.3:22
fwd --from :9000 --to 172.28.128.3:22# get a shell on 172.28.128.3 via a public endpoint
ssh tcp.ngrok.io -p 1234
```
_With great power comes great responsibility._ - Ben Parker### Simple Use Case
Forwarding a local port to a remote port on a different network:```
+---------+ +---------+
192.168.1.99:8000 | | 172.28.128.3:80 | |
curl +---------------------> | fwd | +-------------------------> | web |
| | 172.28.128.1 | |
+---------+ +---------+
```![demo](docs/fwd_http.gif)
## Install
Get the binaries or build it yourself.### Releases
Download prebuilt binaries for several platforms and architectures:[Releases](https://github.com/kintoandar/fwd/releases)
### Go Tool
```
go get github.com/kintoandar/fwd/...
go install github.com/kintoandar/fwd/...
```## Usage
```
usage: fwd []Name:
fwd - 🚂 The little forwarder that could
Author:
Joel Bastos @kintoandar
Example:
fwd --from localhost:8000 --to example.com:80
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
-f, --from="127.0.0.1:8000" Local address to bind port (host:port)
-t, --to="example.com:80" Remote address to forward traffic (host:port)
-v, --version Version details
-l, --list List local network addresses available
--log.level=info Logging level (error, warn, info, debug)
--log.format=logfmt Logging format (logfmt, json)
--config=CONFIG Configuration file path (overrides all flags)
```### Configuration file
For multiport forwarding support, please check [the example configuration file](config.yml).## Credits
Made with ♥️ by [kintoandar](https://blog.kintoandar.com)