{"id":15412243,"url":"https://github.com/robthree/nugetproxy","last_synced_at":"2026-01-28T22:35:32.825Z","repository":{"id":237775732,"uuid":"795227561","full_name":"RobThree/NuGetProxy","owner":"RobThree","description":"NuGet proxy that allows anonymous access to NuGet servers that require authentication.","archived":false,"fork":false,"pushed_at":"2024-05-03T19:23:15.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T08:06:27.703Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/RobThree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":["RobThree"],"custom":["https://paypal.me/robiii"]}},"created_at":"2024-05-02T20:50:44.000Z","updated_at":"2025-04-28T07:32:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f08c88b-c04e-433e-87a4-a3d82d671eda","html_url":"https://github.com/RobThree/NuGetProxy","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":"0.33333333333333337","last_synced_commit":"9530cd4140b6b132dd4f2957cae2101bc1311b61"},"previous_names":["robthree/nugetproxy"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/RobThree/NuGetProxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobThree%2FNuGetProxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobThree%2FNuGetProxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobThree%2FNuGetProxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobThree%2FNuGetProxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobThree","download_url":"https://codeload.github.com/RobThree/NuGetProxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobThree%2FNuGetProxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"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-01T16:51:56.962Z","updated_at":"2026-01-28T22:35:32.809Z","avatar_url":"https://github.com/RobThree.png","language":"C#","readme":"# \u003cimg src=\"logo.svg\" width=\"32\"\u003e NuGet proxy\n\nThis is a simple, cross platform (Windows / Linux / MacOS), proxy for NuGet servers that insist on requiring authentication ([looking at you, GitLab](https://gitlab.com/gitlab-org/gitlab/-/issues/293684)) but where you want to allow public access to the packages. This project uses [YARP](https://microsoft.github.io/reverse-proxy/index.html) to (reverse) proxy requests to the NuGet server and adds an accesstoken to each request. Any responsebodies with a content type of `application/json` will be rewritten to contain the URL of the proxy instead of the actual NuGet server behind the proxy so everything keeps working as expected.\n\nℹ️ Since this project doesn't have a clue on what response structures exist, replacements of the URLs is done in a simple \"find and replace\" fashion on all string nodes. This _could_, potentially, be dangerous or could replace URLs that shouldn't be replaced (like URLs in metadata). It _should_ be safe enough though since we only replace the NuGet server url specifically. Since I can't be bothered to implement all responses and, as a consequence, keep up with future changes in NuGet, I opted to go for this _\"quick'n'dirty\"_ route. Now you know, just be aware. And [let me know](https://github.com/RobThree/NuGetProxy/issues/new) if you run into any issues.\n\n## Usage\n\nTo configure the proxy, change the appsettings:\n\n```json\n{\n  \"Kestrel\": {\n    \"Endpoints\": {\n      \"Http\": {\n        \"Url\": \"http://my.nuget.org:5000\"\n      }\n  },\n  \"PathBase\": \"/NuGet\",\n  \"ReverseProxy\": {\n    \"Routes\": {\n      \"CatchAllRoute\": {\n        \"ClusterId\": \"NuGetCluster\",\n        \"Match\": {\n          \"Path\": \"{**catch-all}\"\n        },\n        \"Transforms\": [\n          {\n            \"RequestHeader\": \"X-NuGet-ApiKey\",\n            \"Set\": \"glpat-ExaMplEKeyExAmplEKey\"\n          }\n        ]\n      }\n    },\n    \"Clusters\": {\n      \"NuGetCluster\": {\n        \"Destinations\": {\n          \"Nuget\": {\n            \"Address\": \"https://my.gitlab.org/api/v4/projects/69/packages/nuget\"\n          }\n        }\n      }\n    }\n  },\n  \"Logging\": {\n    \"LogLevel\": {\n      \"Default\": \"Information\",\n      \"Microsoft\": \"Warning\",\n      \"Yarp\": \"Warning\",\n      \"Microsoft.Hosting.Lifetime\": \"Information\"\n    }\n  }\n}\n```\n\nThe values you need to set / change are the following:\n\n* `Url`: The URL(s)/port(s) at which the proxy will be listening.\n* `PathBase`: (OPTIONAL) The path base that the proxy will be using. This is useful if you want to host multiple proxies on the same server.\n* `ApiKey`: The API key that will be used to authenticate with the NuGet server.\n* `Address`: The URL of the NuGet server feed.\n\nNext, start the proxy and configure your NuGet client to use the proxy: set the `source` to the URL of the proxy + `PathBase` and add `index.json` to the end of the URL. For example: if you configured the `Url` as `http://localhost:5000/` and `PathBase` as `MyNuGet` then set the NuGet source for your client to `http://localhost:5000/MyNuGet/index.json`.\n\n## What accesstoken?\n\nFor GitLab, you can create an access token by going to the NuGet repository -\u003e Settings -\u003e Access Tokens -\u003e Add new Token. Give the token a name (like `NuGetProxy`), expiration date and give `read_api` permissions, make sure role is at least `reporter`.\n\nNote that when the token expires, you _will_ need to update the token in the appsettings (and _maybe_ restart the proxy, but shouldn't be necessary).\n\n## Can I push via the proxy?\n\nNo, the proxy is read-only. If you want to push packages, you will need to push them directly to the NuGet server.\n\n## HTTPS \u0026 TLS\n\nYou can use HTTPS \u0026 TLS; documentation on how to configure YARP can be found [here](https://microsoft.github.io/reverse-proxy/articles/https-tls.html). Basically, you'd add something like this:\n\n```json\n\"Https\": {\n    \"Url\": \"https://my.nuget.org:5001\",\n    \"Certificate\": {\n        \"Path\": \"my.nuget.org.pfx\",\n        \"Password\": \"ExAmplePa$$w0rd*\u0026\"\n    }\n}\n```\n\n## Running as service\n\nBelow are instructions on how to run the proxy as a service on Linux and Windows. The instructions are for systemd on Linux and for the Windows Service Control Manager on Windows.\n\n### Debian\n\n1. Make a directory for the service (example we'll use here is `/usr/local/bin/nugetproxy`)\n2. Copy the binaries to `/usr/local/bin/nugetproxy`\n3. Add/edit the `appsettings.json` in the app directory\n4. Create `/etc/systemd/system/nugetproxy.service` with the following contents:\n    ```bash\n\t[Unit]\n\tDescription=NuGetProxy\n\n\t[Service]\n\tType=notify\n\tExecStart=/usr/local/bin/nugetproxy/NuGetProxy\n\tWorkingDirectory=/usr/local/bin/nugetproxy/\n\tUser=root\n\n\t# ensure the service restarts after crashing\n\tRestart=always\n\t# amount of time to wait before restarting the service\n\tRestartSec=5\n\n\t[Install]\n\tWantedBy=multi-user.target\n    ```\n5. Make the executable executable: `chmod +x /usr/local/bin/nugetproxy/NuGetProxy`\n6. Enable the service: `systemctl enable nugetproxy`\n7. Run `systemctl daemon-reload` for systemd to pick up the new service\n8. You can now start/stop service like any other service: `service nugetproxy start`\n\n### Windows\n\n1. Make a directory for the service (example we'll use here is `C:\\Program Files\\NuGetProxy`)\n2. Copy the binaries to `C:\\Program Files\\NuGetProxy`\n3. Add/edit the `appsettings.json` in the app directory\n4. Open a command prompt as administrator and run the following command:\n    ```cmd\n    sc create NuGetProxy binPath= \"C:\\Program Files\\NuGetProxy\\NuGetProxy.exe\" start= auto\n    ```\n    ⚠️ [Note the space(s)](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create#remarks) after `binPath= ` and `start= `\n5. You can now start/stop service like any other service: `sc start NuGetProxy`","funding_links":["https://github.com/sponsors/RobThree","https://paypal.me/robiii"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobthree%2Fnugetproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobthree%2Fnugetproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobthree%2Fnugetproxy/lists"}