Proxy GitHub with Go

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

Go Proxy Best Practice: Add Mirror Repository

JFrog highly recommends that you create a remote repository pointing to the default Go mirror (proxy.golang.org) and enter Artifactory as the Git provider. This way, Artifactory will be able to resolve cached public modules without querying the external registry, reducing the chance of rate limiting. For more information, see Set Up Go Proxy Mirror Repositories.

To create a Remote Repository which serves as a caching proxy for github.com, follow the steps below:

  1. Create a new remote repository and set Go to be its Package Type.

  2. Set the Repository Key value, and enter https://github.com/ in the URL field as displayed below.

    Proxy_GitHub_with_Go.png
  3. In the Basic tab, enter the username and password of your GitHub account. This is required due to a rate limit imposed by GitHub when access is anonymous.

    From November 2020, GitHub no longer accepts account passwords when authenticating via the REST API

    As per the latest GitHub update, basic authentication is no longer supported via REST API. Your password must be replaced with a GitHub private access token.

  4. Scroll down to Go Settings and select GitHub Cloud for the Git Provider, as shown below.

    Proxy_GitHub_with_Go.png
  5. In the Advanced tab, check Lenient Host Authentication.

  6. Click Save & Finish.