Surgex v2.23.0 Surgex.RPC.HTTPAdapter

Transports RPC calls through HTTP requests protected with a secret header.

Usage

In order to use this adapter in your client, use the following code:

defmodule MyProject.MyRPC do
  use Surgex.RPC.Client

  transport :http,
    url: "https://app.example.com/rpc",
    secret: "my-rpc-secret"

  # ...
end

You can also configure the adapter per environment in your Mix config as follows:

config :my_project, MyProject.MyRPC,
  transport: [adapter: :http,
              url: {:system, "MY_RPC_URL"},
              secret: {:system, "MY_RPC_SECRET"}]