# carldanley/udp-director

![[https://microbadger.com/images/carldanley/udp-director]()](https://images.microbadger.com/badges/image/carldanley/udp-director.svg) [![Build Status](https://github.ci.carldanley.com/api/badges/carldanley/node-udp-director/status.svg)](https://github.ci.carldanley.com/carldanley/node-udp-director)

> A tool that is capable of redirecting UDP traffic from a specific port to as many hosts as needed.

## Get Started

To run the udp-director, you can perform the following command:

`docker run -d --name=udp-director -p 8000:8000/udp carldanley/udp-director 8000=192.168.1.1:30002,192.168.1.2:30002`

The above command will tell udp-director to direct all UDP traffic on port 80 to/from both "receivers" at 192.168.1.1 and 192.168.1.2 on port 30002. It also exposes the docker container's port 8000 to the localhost; thus, allowing you to redirect UDP traffic from localhost to any set of ip addresses and ports.

If you wanted to redirect more than one port's traffic to different sets of "receivers", you could run something like this:

`docker run -d --name=udp-director -p 8000:8000/udp -p 12000:12000/udp carldanley/udp-director 8000=192.168.1.1:2100 12000=192.168.1.2:1200,192.168.1.3`

The above command will setup 2 directors: (1) will direct all udp traffic on port 8000 to/from 192.168.1.1 on port 2100 and (2) will direct all udp traffic on port 12000 to/from both receivers at 192.168.1.2 (port 1200) and 192.168.1.3 (port 80).

Note: if no port is specified for a "receiver", port 80 is used.

## Using File Configuration

You can instruct udp-director to use a configuration file for the settings by performing the following command:

`docker run -d --name=udp-director -p 8000:8000/udp carldanley/udp-director -c /config/example.json`

Please note that the above command will attempt to use a file located at `/config/example.json`; if this file does not exist, udp-director will not run.

### Example JSON Configuration File

For an example configuration file, check [here](https://github.com/carldanley/node-udp-director/blob/master/config-example.json).

## Have Issues?

If you have any questions or concerns, please feel free to record them on GitHub at this location: [https://github.com/carldanley/node-udp-director/issues](https://github.com/carldanley/node-udp-director/issues).
