> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Service endpoint configuration: Server-side SDKs

> This topic explains how to configure LaunchDarkly SDKs to connect to alternate service endpoints. Typically this is only required for customers working with the LaunchDarkly federal instance. This page covers server-side sdks.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## Server-side SDKs

This feature is available for the following server-side SDKs:

* [.NET (server-side)](#net-server-side)
* [Apex](#apex)
* [C++ (server-side)](#c-server-side)
* [Erlang](#erlang)
* [Go](#go)
* [Haskell](#haskell)
* [Java](#java)
* [Lua](#lua)
* [Node.js (server-side)](#nodejs-server-side)
* [PHP](#php)
* [Python](#python)
* [Ruby](#ruby)
* [Rust](#rust)

### .NET (server-side)

<Accordion title="Expand .NET (server-side) code sample">
  To configure an alternate service endpoint for the SDK, use the `ServiceEndpoints` builder method to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```csharp title="C#, connecting to Relay Proxy" theme={null}
          var config = Configuration.Builder("YOUR_SDK_KEY")
              .ServiceEndpoints(Components.ServiceEndpoints()
                .RelayProxy("https://your-relay-proxy.com:8030"))
              .Build();
    ```

    ```csharp title="C#, connecting to federal instance" theme={null}
          var config = Configuration.Builder("YOUR_SDK_KEY")
              .ServiceEndpoints(Components.ServiceEndpoints()
                .Streaming("https://stream.launchdarkly.us")
                .Polling("https://sdk.launchdarkly.us")
                .Events("https://events.launchdarkly.us"))
              .Build();
    ```

    ```csharp title="C#, connecting to EU instance" theme={null}
          var config = Configuration.Builder("YOUR_SDK_KEY")
              .ServiceEndpoints(Components.ServiceEndpoints()
                .Streaming("https://stream.eu.launchdarkly.com")
                .Polling("https://sdk.eu.launchdarkly.com")
                .Events("https://events.eu.launchdarkly.com"))
              .Build();
    ```
  </CodeGroup>
</Accordion>

### Apex

<Accordion title="Expand Apex code sample">
  First, set up the Apex bridge. If you are a federal customer, make sure you run the Apex bridge within your own FedRAMP-compliant environment. To learn more, read [Use the LaunchDarkly Salesforce bridge](/sdk/server-side/apex#use-the-launchdarkly-salesforce-bridge).

  To configure an alternate service endpoint for the SDK, export the alternate URIs before you build the bridge:

  <CodeGroup>
    ```bash title="Console, connecting to federal instance" theme={null}
          cd bridge && go build .

          # other required export statements...

          export LD_BASE_URI='https://sdk.launchdarkly.us'
          export LD_EVENTS_URL='https://events.launchdarkly.us'

          ./bridge
    ```

    ```bash title="Console, connecting to EU instance" theme={null}
          cd bridge && go build .

          # other required export statements...

          export LD_BASE_URI='https://sdk.eu.launchdarkly.com'
          export LD_EVENTS_URL='https://events.eu.launchdarkly.com'

          ./bridge
    ```
  </CodeGroup>
</Accordion>

### C++ (server-side)

<Accordion title="Expand C++ (server-side) code sample">
  To configure an alternate service endpoint for the SDK, use `StreamingBaseUrl`, `PollingBaseUrl`, and `EventsBaseUrl` to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```cpp title="C++ SDK v3.0 (native), connecting to Relay Proxy" theme={null}
          auto config_builder = server_side::ConfigBuilder("YOUR_SDK_KEY");
          config_builder.ServiceEndpoints()
              .RelayProxyBaseUrl("https://your-relay-proxy.com:8030");
          auto config = config_builder.Build();
          if (!config) {
              /* an error occurred, config is not valid */
          }
    ```

    ```cpp title="C++ SDK v3.0 (C binding), connecting to Relay Proxy" theme={null}
          LDServerConfigBuilder builder = LDServerConfigBuilder_New("YOUR_SDK_KEY");

          LDServerConfigBuilder_ServiceEndpoints_RelayProxyBaseURL(builder, "https://your-relay-proxy.com:8030")

          LDServerConfig config;
          LDStatus status = LDServerConfigBuilder_Build(builder, &config);
          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```

    ```c title="C SDK v2.x (native), connecting to Relay Proxy" theme={null}
          struct LDConfig *config = LDConfigNew("YOUR_SDK_KEY");
          LDConfigSetStreamURI(config, "https://your-relay-proxy.com:8030");
          LDConfigSetBaseURI(config, "https://your-relay-proxy.com:8030");
          LDConfigSetEventsURI(config, "https://your-relay-proxy.com:8030");
    ```

    ```cpp title="C++ SDK v3.0 (native), connecting to federal instance" theme={null}
          auto config_builder = server_side::ConfigBuilder("YOUR_SDK_KEY");
          config_builder.ServiceEndpoints()
              .StreamingBaseUrl("https://stream.launchdarkly.us")
              .PollingBaseUrl("https://sdk.launchdarkly.us")
              .EventsBaseUrl("https://events.launchdarkly.us")
          auto config = config_builder.Build();
          if (!config) {
              /* an error occurred, config is not valid */
          }
    ```

    ```c title="C++ SDK v3.0 (C binding), connecting to federal instance" theme={null}
          LDServerConfigBuilder builder = LDServerConfigBuilder_New("YOUR_SDK_KEY");
          LDServerConfigBuilder_ServiceEndpoints_StreamingBaseURL(builder, "https://stream.launchdarkly.us")
          LDServerConfigBuilder_ServiceEndpoints_PollingBaseURL(builder, "https://sdk.launchdarkly.us")
          LDServerConfigBuilder_ServiceEndpoints_EventsBaseURL(builder, "https://events.launchdarkly.us")
          LDServerConfig config;

          LDStatus status = LDServerConfigBuilder_Build(builder, &config);

          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```

    ```c title="C SDK v2.x (native), connecting to federal instance" theme={null}
          struct LDConfig *config = LDConfigNew("YOUR_SDK_KEY");
          LDConfigSetStreamURI(config, "https://stream.launchdarkly.us");
          LDConfigSetBaseURI(config, "https://sdk.launchdarkly.us");
          LDConfigSetEventsURI(config, "https://events.launchdarkly.us");
    ```

    ```cpp title="C++ SDK v3.0 (native), connecting to EU instance" theme={null}
          auto config_builder = server_side::ConfigBuilder("YOUR_SDK_KEY");
          config_builder.ServiceEndpoints()
              .StreamingBaseUrl("https://stream.eu.launchdarkly.com")
              .PollingBaseUrl("https://sdk.eu.launchdarkly.com")
              .EventsBaseUrl("https://events.eu.launchdarkly.com")
          auto config = config_builder.Build();
          if (!config) {
              /* an error occurred, config is not valid */
          }
    ```

    ```c title="C++ SDK v3.0 (C binding), connecting to EU instance" theme={null}
          LDServerConfigBuilder builder = LDServerConfigBuilder_New("YOUR_SDK_KEY");
          LDServerConfigBuilder_ServiceEndpoints_StreamingBaseURL(builder, "https://stream.eu.launchdarkly.com")
          LDServerConfigBuilder_ServiceEndpoints_PollingBaseURL(builder, "https://sdk.eu.launchdarkly.com")
          LDServerConfigBuilder_ServiceEndpoints_EventsBaseURL(builder, "https://events.eu.launchdarkly.com")
          LDServerConfig config;

          LDStatus status = LDServerConfigBuilder_Build(builder, &config);

          if (!LDStatus_Ok(status)) {
              /* an error occurred, config is not valid */
          }
    ```

    ```c title="C SDK v2.x (native), connecting to EU instance" theme={null}
          struct LDConfig *config = LDConfigNew("YOUR_SDK_KEY");
          LDConfigSetStreamURI(config, "https://stream.eu.launchdarkly.com");
          LDConfigSetBaseURI(config, "https://sdk.eu.launchdarkly.com");
          LDConfigSetEventsURI(config, "https://events.eu.launchdarkly.com");
    ```
  </CodeGroup>

  To learn more, read `ServiceEndpoints()` in [`ConfigBuilder`](https://launchdarkly.github.io/cpp-sdks/libs/server-sdk/docs/html/classlaunchdarkly_1_1config_1_1shared_1_1builders_1_1ConfigBuilder.html).
</Accordion>

### Erlang

<Accordion title="Expand Erlang code sample">
  To configure an alternate service endpoint for the SDK, use the `stream_uri`, `base_uri`, and `events_uri` properties to set the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```erlang title="Erlang, connecting to Relay Proxy" theme={null}
          ldclient:start_instance("YOUR_SDK_KEY", #{
            stream_uri => "https://your-relay-proxy.com:8030",
            base_uri => "https://your-relay-proxy.com:8030",
            events_uri => "https://your-relay-proxy.com:8030"
          })
    ```

    ```erlang title="Erlang, connecting to federal instance" theme={null}
          ldclient:start_instance("YOUR_SDK_KEY", #{
            stream_uri => "https://stream.launchdarkly.us",
            base_uri => "https://sdk.launchdarkly.us",
            events_uri => "https://events.launchdarkly.us"
          })
    ```

    ```erlang title="Erlang, connecting to EU instance" theme={null}
          ldclient:start_instance("YOUR_SDK_KEY", #{
            stream_uri => "https://stream.eu.launchdarkly.com",
            base_uri => "https://sdk.eu.launchdarkly.com",
            events_uri => "https://events.eu.launchdarkly.com"
          })
    ```
  </CodeGroup>
</Accordion>

### Go

<Accordion title="Expand Go code sample">
  To configure an alternate service endpoint for the SDK, use the `Config.ServiceEndpoints` property and `interfaces.ServiceEndpoints()` to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```go title="Go, connecting to Relay Proxy" theme={null}
          // To use the Replay Proxy in proxy mode for both streaming and events:

          config := ld.Config{
              ServiceEndpoints: ldcomponents.RelayProxyEndpoints(
                "https://your-relay-proxy.com:8030"),
          }

          // Alternatively, to use the Relay Proxy in proxy mode for streaming,
          // but send events directly to LaunchDarkly, use:
          config := ld.Config{
              ServiceEndpoints: ldcomponents.RelayProxyEndpointsWithoutEvents(
                  "https://your-relay-proxy.com:8030"),
          }
    ```

    ```go title="Go, connecting to federal instance" theme={null}

          config := ld.Config{
              ServiceEndpoints: interfaces.ServiceEndpoints{
                Streaming: "https://stream.launchdarkly.us",
                Polling: "https://sdk.launchdarkly.us",
                Events: "https://events.launchdarkly.us",
              },
          }
    ```

    ```go title="Go, connecting to EU instance" theme={null}

          config := ld.Config{
              ServiceEndpoints: interfaces.ServiceEndpoints{
                Streaming: "https://stream.eu.launchdarkly.com",
                Polling: "https://sdk.eu.launchdarkly.com",
                Events: "https://events.eu.launchdarkly.com",
              },
          }
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Go SDK version 7.6 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, read [`EnableGzip`](https://pkg.go.dev/github.com/launchdarkly/go-server-sdk/v7/ldcomponents#EventProcessorBuilder.EnableGzip) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### Haskell

<Accordion title="Expand Haskell code sample">
  To configure an alternate service endpoint for the SDK, use `configSetStreamURI`, `configSetBaseURI`, and `configSetEventsURI` to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```haskell title="Haskell, connecting to Relay Proxy" theme={null}
          {-# LANGUAGE OverloadedStrings #-}

          import LaunchDarkly.Server.Config

          import Data.Function ((&))

          config :: Config
          config = (makeConfig "YOUR_SDK_KEY")
              & configSetStreamURI "https://your-relay-proxy.com:8030"
              & configSetBaseURI "https://your-relay-proxy.com:8030"
              & configSetEventsURI "https://your-relay-proxy.com:8030"
    ```

    ```haskell title="Haskell, connecting to federal instance" theme={null}
          {-# LANGUAGE OverloadedStrings #-}

          import LaunchDarkly.Server.Config

          import Data.Function ((&))

          config :: Config
          config = (makeConfig "YOUR_SDK_KEY")
              & configSetStreamURI "https://stream.launchdarkly.us"
              & configSetBaseURI "https://sdk.launchdarkly.us"
              & configSetEventsURI "https://events.launchdarkly.us"
    ```

    ```haskell title="Haskell, connecting to EU instance" theme={null}
          {-# LANGUAGE OverloadedStrings #-}

          import LaunchDarkly.Server.Config

          import Data.Function ((&))

          config :: Config
          config = (makeConfig "YOUR_SDK_KEY")
              & configSetStreamURI "https://stream.eu.launchdarkly.com"
              & configSetBaseURI "https://sdk.eu.launchdarkly.com"
              & configSetEventsURI "https://events.eu.launchdarkly.com"
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Haskell SDK version 4.4 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, read [`configSetCompressEvents`](https://launchdarkly.github.io/haskell-server-sdk/LaunchDarkly-Server-Config.html#v:configSetCompressEvents) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### Java

<Accordion title="Expand Java code sample">
  To configure an alternate service endpoint for the SDK, use the `serviceEndpoints` builder method to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```java title="Java, connecting to Relay Proxy" theme={null}
          LDConfig config = new LDConfig.Builder()
            .serviceEndpoints(Components.serviceEndpoints()
              .relayProxy("https://your-relay-proxy.com:8030"))
            .build();
    ```

    ```java title="Java, connecting to federal instance" theme={null}
          LDConfig config = new LDConfig.Builder()
            .serviceEndpoints(Components.serviceEndpoints()
              .streaming("https://stream.launchdarkly.us")
              .polling("https://sdk.launchdarkly.us")
              .events("https://events.launchdarkly.us"))
            .build();
    ```

    ```java title="Java, connecting to EU instance" theme={null}
          LDConfig config = new LDConfig.Builder()
            .serviceEndpoints(Components.serviceEndpoints()
              .streaming("https://stream.eu.launchdarkly.com")
              .polling("https://sdk.eu.launchdarkly.com")
              .events("https://events.eu.launchdarkly.com"))
            .build();
    ```
  </CodeGroup>
</Accordion>

### Lua

<Accordion title="Expand Lua code sample">
  To configure an alternate service endpoint for the SDK, use the `serviceEndpoints` property to specify the base URLs. Here are some examples for common base URLs that you might use instead of the defaults:

  <CodeGroup>
    ```lua title="Lua, connecting to Relay Proxy, v2" theme={null}
          local config = {
              serviceEndpoints = {
                streamingBaseURL = "https://your-relay-proxy.com:8030",
                pollingBaseURL = "https://your-relay-proxy.com:8030",
                eventsBaseURL = "https://your-relay-proxy.com:8030"
              }
          }
    ```

    ```lua title="Lua, connecting to Relay Proxy, v1.x" theme={null}
          local config = {
              key = "YOUR_SDK_KEY",
              streamURI = "https://your-relay-proxy.com:8030",
              baseURI = "https://your-relay-proxy.com:8030",
              eventsURI = "https://your-relay-proxy.com:8030",
          }
    ```

    ```lua title="Lua, connecting to federal instance, v2" theme={null}
          local config = {
              serviceEndpoints = {
                streamingBaseURL = "https://stream.launchdarkly.us",
                pollingBaseURL = "https://sdk.launchdarkly.us",
                eventsBaseURL = "https://events.launchdarkly.us"
              }
          }
    ```

    ```lua title="Lua, connecting to federal instance, v1.x" theme={null}
          local config = {
              key = "YOUR_SDK_KEY",
              streamURI = "https://stream.launchdarkly.us",
              baseURI = "https://sdk.launchdarkly.us",
              eventsURI = "https://events.launchdarkly.us",
          }
    ```

    ```lua title="Lua, connecting to EU instance, v2" theme={null}
          local config = {
              serviceEndpoints = {
                streamingBaseURL = "https://stream.eu.launchdarkly.com",
                pollingBaseURL = "https://sdk.eu.launchdarkly.com",
                eventsBaseURL = "https://events.eu.launchdarkly.com"
              }
          }
    ```

    ```lua title="Lua, connecting to EU instance, v1.x" theme={null}
          local config = {
              key = "YOUR_SDK_KEY",
              streamURI = "https://stream.eu.launchdarkly.com",
              baseURI = "https://sdk.eu.launchdarkly.com",
              eventsURI = "https://events.eu.launchdarkly.com",
          }
    ```
  </CodeGroup>

  To learn more about the configuration options, read [`clientInit`](https://launchdarkly.github.io/lua-server-sdk/modules/launchdarkly-server-sdk.html#clientInit).
</Accordion>

### Node.js (server-side)

<Accordion title="Expand Node.js (server-side) code sample">
  To configure an alternate service endpoint for the SDK, use the `streamUri`, `baseUri`, and `eventsUri` properties to specify the base URIs.

  Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```ts title="Node.js SDK v8.x (TypeScript), connecting to Relay Proxy" theme={null}
          import { LDOptions } from '@launchdarkly/node-server-sdk';

          const options: LDOptions = {
            streamUri: 'https://your-relay-proxy.com:8030',
            baseUri: 'https://your-relay-proxy.com:8030',
            eventsUri: 'https://your-relay-proxy.com:8030',
          };
    ```

    ```ts title="Node.js SDK v8.x (TypeScript), connecting to federal instance" theme={null}
          import { LDOptions } from '@launchdarkly/node-server-sdk';

          const options: LDOptions = {
            streamUri: 'https://stream.launchdarkly.us',
            baseUri: 'https://sdk.launchdarkly.us',
            eventsUri: 'https://events.launchdarkly.us',
          };
    ```

    ```ts title="Node.js SDK v8.x (TypeScript), connecting to EU instance" theme={null}
          import { LDOptions } from '@launchdarkly/node-server-sdk';

          const options: LDOptions = {
            streamUri: 'https://stream.eu.launchdarkly.com',
            baseUri: 'https://sdk.eu.launchdarkly.com',
            eventsUri: 'https://events.eu.launchdarkly.com',
          };
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Node.js (server-side) SDK version 9.8 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, read [`enableEventCompression`](https://launchdarkly.github.io/js-core/packages/sdk/server-node/docs/interfaces/LDOptions.html#enableEventCompression) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### PHP

<Accordion title="Expand PHP code sample">
  To configure an alternate service endpoint for the SDK, use the `base_uri` and `events_uri` properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```php title="PHP, connecting to Relay Proxy" theme={null}
          $client = new LaunchDarkly\LDClient("YOUR_SDK_KEY",
              [ "base_uri" => "https://your-relay-proxy.com:8030",
                "events_uri" => "https://your-relay-proxy.com:8030" ]);
    ```

    ```php title="PHP, connecting to federal instance" theme={null}
          $client = new LaunchDarkly\LDClient("YOUR_SDK_KEY",
              [ "base_uri" => "https://sdk.launchdarkly.us",
                "events_uri" => "https://events.launchdarkly.us" ]);
    ```

    ```php title="PHP, connecting to EU instance" theme={null}
          $client = new LaunchDarkly\LDClient("YOUR_SDK_KEY",
              [ "base_uri" => "https://sdk.eu.launchdarkly.com",
                "events_uri" => "https://events.eu.launchdarkly.com" ]);
    ```
  </CodeGroup>

  There is not a streaming service for the PHP SDK.
</Accordion>

### Python

<Accordion title="Expand Python code sample">
  To configure an alternate service endpoint for the SDK, use the `stream_uri`, `base_uri`, and `events_uri` properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```python title="Python, connecting to Relay Proxy" theme={null}
          config = Config(sdk_key='YOUR_SDK_KEY',
            stream_uri="https://your-relay-proxy.com:8030",
            base_uri="https://your-relay-proxy.com:8030",
            events_uri="https://your-relay-proxy.com:8030")
    ```

    ```python title="Python, connecting to federal instance" theme={null}
          config = Config(sdk_key='YOUR_SDK_KEY',
            stream_uri="https://stream.launchdarkly.us",
            base_uri="https://sdk.launchdarkly.us",
            events_uri="https://events.launchdarkly.us")
    ```

    ```python title="Python, connecting to EU instance" theme={null}
          config = Config(sdk_key='YOUR_SDK_KEY',
            stream_uri="https://stream.eu.launchdarkly.com",
            base_uri="https://sdk.eu.launchdarkly.com",
            events_uri="https://events.eu.launchdarkly.com")
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Python SDK version 9.5 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, set [`enable_event_compression`](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-main.html#ldclient.config.Config.enable_event_compression) in the [`ldclient.config` module](https://launchdarkly-python-sdk.readthedocs.io/en/latest/api-main.html#module-ldclient.config) and read [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### Ruby

<Accordion title="Expand Ruby code sample">
  To configure an alternate service endpoint for the SDK, use the `stream_uri`, `base_uri`, and `events_uri` properties to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```ruby title="Ruby, connecting to Relay Proxy" theme={null}
          config = LaunchDarkly::Config.new(
            stream_uri: "https://your-relay-proxy.com:8030",
            base_uri: "https://your-relay-proxy.com:8030",
            events_uri: "https://your-relay-proxy.com:8030")
    ```

    ```ruby title="Ruby, connecting to federal instance" theme={null}
          config = LaunchDarkly::Config.new(
            stream_uri: "https://stream.launchdarkly.us",
            base_uri: "https://sdk.launchdarkly.us",
            events_uri: "https://events.launchdarkly.us")
    ```

    ```ruby title="Ruby, connecting to EU instance" theme={null}
          config = LaunchDarkly::Config.new(
            stream_uri: "https://stream.eu.launchdarkly.com",
            base_uri: "https://sdk.eu.launchdarkly.com",
            events_uri: "https://events.eu.launchdarkly.com")
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Ruby SDK version 8.7 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, read [`compress_events`](https://launchdarkly.github.io/ruby-server-sdk/LaunchDarkly/Config.html#compress_events-instance_method) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>

### Rust

<Accordion title="Expand Rust code sample">
  To configure an alternate service endpoint for the SDK, use the `ConfigBuilder` and `ServiceEndpointsBuilder` to specify the base URIs. Here are some examples for common base URIs that you might use instead of the defaults:

  <CodeGroup>
    ```rust title="Rust, connecting to Relay Proxy" theme={null}
          let config = ConfigBuilder::new("YOUR_SDK_KEY")
              .service_endpoints(
                  ServiceEndpointsBuilder::new().relay_proxy("https://your-relay-proxy.com:8030"),
              )
              .build();
    ```

    ```rust title="Rust, connecting to federal instance" theme={null}
          let config = ConfigBuilder::new("YOUR_SDK_KEY").service_endpoints(ServiceEndpointsBuilder::new()
            .streaming_base_url("https://stream.launchdarkly.us")
            .polling_base_url("https://sdk.launchdarkly.us")
            .events_base_url("https://events.launchdarkly.us"));
    ```

    ```rust title="Rust, connecting to EU instance" theme={null}
          let config = ConfigBuilder::new("YOUR_SDK_KEY").service_endpoints(ServiceEndpointsBuilder::new()
            .streaming_base_url("https://stream.eu.launchdarkly.com")
            .polling_base_url("https://sdk.eu.launchdarkly.com")
            .events_base_url("https://events.eu.launchdarkly.com"));
    ```
  </CodeGroup>

  <Warning title="Relay Proxy compatibility with event payload compression">
    If you are using LaunchDarkly Rust SDK version 2.4 or greater and you choose to enable compression of event payloads, you **must** upgrade Relay Proxy to version 8.9 or greater. To learn more, read [`compress_events`](https://docs.rs/launchdarkly-server-sdk/latest/launchdarkly_server_sdk/struct.EventProcessorBuilder.html#method.compress_events) and [Configuring an SDK to use the Relay Proxy](/sdk/features/relay-proxy-configuration#configuring-an-sdk-to-use-the-relay-proxy).
  </Warning>
</Accordion>
