{"id":15697869,"url":"https://github.com/fleny113/udp-forwarder","last_synced_at":"2026-03-01T22:02:57.643Z","repository":{"id":254155384,"uuid":"845565430","full_name":"Fleny113/udp-forwarder","owner":"Fleny113","description":"A very use-case specific tool to forward UDP packets","archived":false,"fork":false,"pushed_at":"2026-01-25T21:08:30.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-25T22:48:03.822Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fleny113.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T13:49:13.000Z","updated_at":"2026-01-25T21:08:33.000Z","dependencies_parsed_at":"2024-10-24T02:56:54.185Z","dependency_job_id":"91ce4899-fd96-4b35-b68f-c49bb6d187ed","html_url":"https://github.com/Fleny113/udp-forwarder","commit_stats":null,"previous_names":["fleny113/udp-forwarder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Fleny113/udp-forwarder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2Fudp-forwarder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2Fudp-forwarder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2Fudp-forwarder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2Fudp-forwarder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fleny113","download_url":"https://codeload.github.com/Fleny113/udp-forwarder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fleny113%2Fudp-forwarder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29986241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T21:06:37.093Z","status":"ssl_error","status_checked_at":"2026-03-01T21:05:45.052Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-03T19:21:57.534Z","updated_at":"2026-03-01T22:02:57.630Z","avatar_url":"https://github.com/Fleny113.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UDP Forwarder\n\nUDP Forwarder is a small program to forward `UDP` packets around.\n\nThis is useful to forward `UDP` packets in `NAT`-ed environments where you can't port-forward properly or you don't have access to the router configuration.\n\nThis has been built for a very specific use-case however you might be able to use it as well.\n\n## Compilation\n\nThere aren't pre-built binaries. You will need a C17 compiler to build it.\n\nThere is a makefile, you can `make server` and `make client` to build respectively the server and the client binaries.\n\n### Debug mode\n\nYou can compile in debug mode by using `DEBUG=1 make server` or `DEBUG=1 make client`. This will enable additional logging to help debugging issues.\n\n## Usage\n\nClient usage:\n```\n./client \u003cserver ip\u003e \u003cserver port\u003e \u003cforward ip\u003e \u003cforward port\u003e \u003cpassword\u003e\n```\n\nServer usage:\n```\n./server \u003cincoming port\u003e \u003cforward port\u003e \u003cpassword\u003e\n```\n\n### Server\n\nThe server will listen to both ports, when it receives a message on the `incoming port` it will send a packet to the `forward port` with the content of the received message, and vice-versa.\n\nUntil a [client](#client) advertizes itself with the password the server will drop all packets. \n\n### Client\n\nThe client will connect to the server at `\u003cserver ip\u003e:\u003cserver port\u003e` and advertize itself by sending the `\u003cpassword\u003e` string.\n\nThen when the client receives packets from the server with the source ip and port for the client it will open a connection to `\u003cforward ip\u003e:\u003cforward port\u003e` and forward the packets there, and vice-versa.\n\nThis allows to have multiple clients connecting to the same server and forwarding packets to different destinations.\n\n## Why not using `socat`\n\n`socat` is a very powerful tool however I have found it to not being able to do what UDP Forwarder does, especially for the client binary. For this reason this tool exists.\n\n## Example use-case (Factorio)\n\n[Factorio](https://factorio.com) uses `UDP` for its multiplayer server, however when the server is in a `NAT`-ed environment and you want to play with friend that is an issue.\n\nTradizionally you would use something like a VPS and an `SSH` tunnel to expose the local port and that works great. However, `SSH` does not support `UDP`, only `TCP`\nand factorio doesn't seem to enjoing having its packet being converted from `UDP` to `TCP` and then from `TCP` to `UDP` again.\n\nTo solve this you can run UDP Forwarder server on the VPS, with a cmdline such as: `./server \u003cport from where you connect\u003e \u003csome port\u003e`.\nAfter you run the command UDP Forwarder will listen to those 2 ports as explained in the server explaination above.\n\nThen on the same server that is running the Factorio server you can run UDP Forwarder client, with a cmdline such as: `./client \u003cvps ip\u003e \u003cvps port\u003e 127.0.0.1 \u003cfactorio port\u003e`.\nAfter that the client will connect to the UDP Forwarder server running on the VPS and advertize itself, as described in the client explaination above.\n\nAfter both server and client are running, when a Factorio client opens a connection with the VPS on the port you decided\nthe UDP Forwarder server on the VPS will send the packets to the UDP Forwarder client running on the server running the Factorio server and then it will send the data to Factorio to handle the connection.\n\nSince this opens a new socket for each different ip + port combination that the server receives, you can have multiple players with a single client and server.\n\n## License\n\nThe code is publish under the MIT licence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleny113%2Fudp-forwarder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleny113%2Fudp-forwarder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleny113%2Fudp-forwarder/lists"}