Skip to main content
Version: v1.40.0

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:

goff-proxy.yaml
# ...
retrievers:
- kind: http
url: https://my-feature-flag-location.com/flags.goff.yaml
# ...
Field nameMandatoryTypeDefaultDescription
kindStringnoneValue should be http.
This field is mandatory and describes which retriever you are using.
urlStringnoneLocation to retrieve the file.
methodStringGETThe HTTP Method you are using to call the HTTP endpoint.
bodyStringnoneThe HTTP Body you are using to call the HTTP endpoint.
headersObjectnoneThe HTTP headers used when calling the HTTP endpoint (useful for authorization).
timeoutString10000Timeout 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:

example.go
err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &httpretriever.Retriever{
URL: "http://example.com/flag-config.goff.yaml",
Timeout: 2 * time.Second,
},
})
defer ffclient.Close()
FieldMandatoryDescription
URLLocation to retrieve the file
(ex: http://mydomain.io/flag.yaml).
Methodthe HTTP method you want to use
(default is GET).
BodyIf you need a body to get the flags.
HeaderHeader you should pass while calling the endpoint (useful for authorization).
TimeoutTimeout for the HTTP call
(default is 10 seconds).