PortForward is a simple TCP port forwarding utility written in Go.
227
PortForward is a simple TCP port forwarding utility written in Go. It listens for incoming connections on a specified local host and port, and forwards the traffic to a specified remote host and port. This can be useful in scenarios where a service is not directly accessible, but can be reached via a port forwarding proxy.
Clone the repository
Run
go build -o portforward
Once you have built the PortForward utility, you can use it by running the following command:
./portforward -LOCAL_PORT <local_port> -REMOTE_HOST <remote_host> -REMOTE_PORT <remote_port>
The following table lists the available command line parameters, their descriptions, whether they are required, and their default values (if applicable).
| Parameter | Description | Required | Default Value |
|---|---|---|---|
| LOCAL_HOST | The local host to listen on. | No | 0.0.0.0 |
| LOCAL_PORT | The local port to listen on. | Yes | - |
| REMOTE_HOST | The remote host to forward traffic to. | Yes | - |
| REMOTE_PORT | The remote port to forward traffic to. | Yes | - |
version: '3.8'
services:
portforward:
image: chubr/portforward
ports:
- "25:25"
environment:
- LOCAL_PORT=25
- REMOTE_HOST=mail.ex.ru
- REMOTE_PORT=25
deploy:
restart_policy:
condition: on-failure
delay: 20s
Content type
Image
Digest
sha256:258202804…
Size
4.8 MB
Last updated
over 3 years ago
docker pull chubr/portforward