Skip to content

HTTP(S) ​

Overview ​

Fetches the configuration from a remote URL over HTTP(S). This retriever is useful when you want to fetch the configuration from a remote server endpoint.

Configure the relay proxy ​

To configure your relay proxy to use the HTTP(S) retriever, you need to add the following configuration to your relay proxy configuration file:

yaml
# ...
retrievers:
  - kind: http
    url: https://my-feature-flag-location.com/flags.yaml
# ...
Field nameMandatoryTypeDefaultDescription
kindYesStringnoneValue should be http.
This field is mandatory and describes which retriever you are using.
urlYesStringnoneLocation to retrieve the file.
methodYesStringGETThe HTTP Method you are using to call the HTTP endpoint.
bodyNoStringnoneThe HTTP Body you are using to call the HTTP endpoint.
headersNoObjectnoneThe HTTP headers used when calling the HTTP endpoint (useful for authorization).
clientCertPathNoStringnonePath to the client certificate file used for mTLS. Must be configured with clientKeyPath.
clientKeyPathNoStringnonePath to the client certificate key file used for mTLS. Must be configured with clientCertPath.
caCertPathNoStringnonePath to the CA certificate file used to verify the server certificate.
timeoutNoString10000Timeout in millisecond when calling the HTTP endpoint.

Configure the GO Module ​

To configure your GO module to use the HTTP(S) retriever, you need to add the following configuration to your ffclient.Config{} object:

go
client, err := ffclient.New(&ffclient.Config{
    PollingInterval: 3 * time.Second,
    Retriever: &httpretriever.Retriever{
        URL:    "http://example.com/flag-config.yaml",
        Timeout: 2 * time.Second,
    },
})
defer client.Close()
FieldMandatoryDescription
URLYesLocation to retrieve the file
(ex: http://mydomain.io/flag.yaml).
MethodNothe HTTP method you want to use
(default is GET).
BodyNoIf you need a body to get the flags.
HeaderNoHeader you should pass while calling the endpoint (useful for authorization).
ClientCertPathNoPath to the client certificate file used for mTLS. Must be configured with ClientKeyPath.
ClientKeyPathNoPath to the client certificate key file used for mTLS. Must be configured with ClientCertPath.
CACertPathNoPath to the CA certificate file used to verify the server certificate.
TimeoutNoTimeout for the HTTP call
(default is 10 seconds).

Released under the MIT License.