Sign inSign up

chubr/portforward

By chubr

Updated over 3 years ago

PortForward is a simple TCP port forwarding utility written in Go.

Image
0

227

chubr/portforward repository overview

PortForward

GitHub Docker Hub

Description

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.

Building

Clone the repository

Run

go build -o portforward

Usage

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>

Command Line Parameters

The following table lists the available command line parameters, their descriptions, whether they are required, and their default values (if applicable).

ParameterDescriptionRequiredDefault Value
LOCAL_HOSTThe local host to listen on.No0.0.0.0
LOCAL_PORTThe local port to listen on.Yes-
REMOTE_HOSTThe remote host to forward traffic to.Yes-
REMOTE_PORTThe remote port to forward traffic to.Yes-

docker-compose

   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

Tag summary

Content type

Image

Digest

sha256:258202804

Size

4.8 MB

Last updated

over 3 years ago

docker pull chubr/portforward