{"id":13813053,"url":"https://github.com/troglobit/redir","last_synced_at":"2025-04-05T20:08:37.887Z","repository":{"id":45132787,"uuid":"57325338","full_name":"troglobit/redir","owner":"troglobit","description":"A TCP port redirector for UNIX","archived":false,"fork":false,"pushed_at":"2022-07-02T13:57:23.000Z","size":240,"stargazers_count":395,"open_issues_count":7,"forks_count":48,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-05-01T19:34:18.112Z","etag":null,"topics":["inetd","tcp-port-redirector"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/troglobit.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-28T18:36:48.000Z","updated_at":"2024-04-30T04:33:08.000Z","dependencies_parsed_at":"2022-08-25T23:12:32.084Z","dependency_job_id":null,"html_url":"https://github.com/troglobit/redir","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fredir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fredir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fredir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troglobit%2Fredir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troglobit","download_url":"https://codeload.github.com/troglobit/redir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393570,"owners_count":20931813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inetd","tcp-port-redirector"],"created_at":"2024-08-04T04:01:01.085Z","updated_at":"2025-04-05T20:08:37.869Z","avatar_url":"https://github.com/troglobit.png","language":"C","funding_links":[],"categories":["C","others"],"sub_categories":[],"readme":"A TCP port redirector for UNIX\n==============================\n[![GitHub Status][]][GitHub] [![Coverity Status]][Coverity Scan]\n\nThis is a TCP port redirector for UNIX.  It can be run under inetd or as\na standalone daemon (in which case it handles multiple connections).  It\nis 8-bit clean, not limited to line mode, yet small and lightweight.  If\nyou want access control, run it under xinetd or inetd with TCP wrappers.\n\n`redir` listens for TCP connections on a given `SRC:PORT`.  When clients\nconnect to `redir` it initiates a connection to the server on `DST:PORT`\nto pass data between them.  The `SRC` and `DST` are from the perspective\nof `redir`.\n\n```\n                      -------\u003e SRC:PORT -----\u003e DST:PORT\n\nRequest:       CLIENT -------\u003e redir --------\u003e SERVER\n\n\nResponse:      CLIENT \u003c------- redir \u003c-------- SERVER\n                                     --bind=addr\n```\n\n**Note:** the `--bind=ADDR` argument is to limit `redir` on the server\nside reply, in case the box `redir` runs on have multiple addresses or\ninterfaces on the server side.\n\n\u003e `redir` finds most of its applications in traversing firewalls, but,\n\u003e of course, there are other use-cases.  For a UDP port redirector, see\n\u003e [uredir](https://github.com/troglobit/uredir/)\n\n\nUsage\n-----\n\nConsult the man page for details.\n\n    Usage: redir [-hinspv] [-b IP]  [-f TYPE] [-I NAME] [-l LEVEL] [-t SEC]\n                           [-x STR] [-m BPS] [-o FLAG] [-w MSEC] [-z BYTES]\n                           [SRC]:PORT [DST]:PORT\n    Options:\n      -b, --bind=IP            Listen only to IP on the server-side connection,\n                               how DST connects to redir. Not applicable with -p\n      -f, --ftp=TYPE           Redirect FTP connections.  Where type is\n                               one of: 'port', 'pasv', or 'both'\n      -h, --help               Show this help text\n      -i, --inetd              Run from inetd, SRC:PORT comes from stdin\n                               Usage: redir [OPTIONS] [DST]:PORT\n      -I, --ident=NAME         Identity, tag syslog messages with NAME\n                               Also used as service name for TCP wrappers\n      -l, --loglevel=LEVEL     Set log level: none, err, notice*, info, debug\n      -n, --foreground         Run in foreground, do not detach from terminal\n      -p, --transproxy         Run in Linux's transparent proxy mode\n      -s, --syslog             Log messages to syslog\n      -t, --timeout=SEC        Set timeout to SEC seconds, default off (0)\n      -v, --version            Show program version\n      -x, --connect=STR        CONNECT string passed to proxy server\n    \n    Traffic Shaping:\n      -m, --max-bandwidth=BPS  Limit the bandwidth to BPS bits/second\n      -o, --wait-in-out=FLAG   Wait for in(1), out(2), or in\u0026out(3)\n      -w, --random-wait=MSEC   Wait MSEC milliseconds before each packet\n      -z, --bufsize=BYTES      Size of the traffic shaping buffer\n    \n    SRC and DST are optional, redir will revert to use 0.0.0.0 (ANY)\n\n\n### Old Syntax\n\nCommand line options changed in v3.0.  A limited subset of the old\nsyntax is available with the `--enable-compat` configure option.\nThis implicitly also enables `-n` by default.\n\nThe following subset of the old syntax are available:\n\n\t  --lport=PORT             Local port (when not running from inetd)\n\t  --laddr=ADDRESS          Local address (when not running from inetd)\n\t  --cport=PORT             Remote port to redirect traffic to\n\t  --caddr=ADDRESS          Remote address to redirect traffic to\n\n\nExamples\n--------\n\nTo redirect port 80 to a webserver listening on loopback port 8080,\nremember to use `sudo` when using priviliged ports:\n\n    sudo redir :80 127.0.0.1:8080\n\nThis starts `redir` as a standard UNIX daemon in the background, with\nall log messages sent to the syslog.  Use `-n` to foreground and see log\nmessages on `stderr`.\n\nTo run `redir` from a process monitor like [Finit][] or systemd, tell it\nto not background itself and to only use the syslog for log messages:\n\n    redir -n -s :80 127.0.0.1:8080\n\nAn `/etc/inetd.conf` line of the same looks very similar:\n\n    http  stream  tcp  nowait  root  /usr/sbin/tcpd /usr/bin/redir -n -s -i 127.0.0.1:8080\n\nWhen running multiple redir instances it can be useful to change how\nthey identify themselves:\n\n    redir -I nntp www:119 netgate:119\n    redir -I pop3 ftp:110 netgate:110\n\nThis starts an NNTP and a POP3 port redirector, named accordingly.\nPreviously therere was a `redir-wrapper` script included in the\ndistribution, but that is no longer maintained.\n\n\nBuilding\n--------\n\nRedir comes with a  GNU configure script which you can  use to adapt the\nbuild  to your  needs.  If  you would  like to  remove support  for some\nextended options (for  the sake of speed, code size,  whatever), try the\nfollowing options to configure:\n\n    --enable-compat    Enable limited v2.x command line syntax\n    --disable-shaper   Disable traffic shaping code\n    --disable-ftp      Disable FTP redirection support\n\nThe GNU Configure \u0026 Build system use `/usr/local` as the default install\nprefix.  For most use-cases this is fine, but if you want to change this\nto `/usr` use the `--prefix=/usr` configure option:\n\n    ./configure --prefix=/usr\n    make -j5\n    sudo make install-strip\n\nBuilding from GIT sources require you have `automake` and `autoconf`\ninstalled.  Use `./autogen.sh` to create the configure script.\n\n\nOrigin \u0026 References\n-------------------\n\nRedir was originally created by Nigel Metheringham and [Sam Creasey][].\nIt is now maintained at [GitHub][1] by [Joachim Wiberg][].  Use GitHub\nto file bug reports, clone, or send pull requests for bug fixes and\nextensions.\n\nRedir is distributed under the terms of the GNU Public Licence, version\n2 or later, distributed with this source archive in the file COPYING.\n\n[Sam Creasey]:     http://sammy.net/~sammy/hacks/\n[Joachim Wiberg]:  http://troglobit.com\n[1]:               https://github.com/troglobit/redir\n[Finit]:           https://github.com/troglobit/finit\n[GitHub]:          https://github.com/troglobit/redir/actions/workflows/build.yml/\n[GitHub Status]:   https://github.com/troglobit/redir/actions/workflows/build.yml/badge.svg\n[Coverity Scan]:   https://scan.coverity.com/projects/8740\n[Coverity Status]: https://scan.coverity.com/projects/8740/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fredir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroglobit%2Fredir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroglobit%2Fredir/lists"}