add custom headers as upstream settings (#761)

* add custom headers

* add docs
This commit is contained in:
Vyacheslav
2025-12-18 20:19:02 +02:00
committed by GitHub
parent 3e845bcdf0
commit b944aa8ac6
16 changed files with 196 additions and 16 deletions

View File

@@ -174,6 +174,41 @@ In case of rpc and ws connection we can specify different modes of works togethe
You can specify this modes through `connector-mode` parameter in connection config.
=== Custom Headers
Dshackle allows you to add custom HTTP headers to all requests sent to an upstream.
This is useful when connecting to providers that require API keys, authentication tokens, or other custom headers.
Custom headers are configured at the upstream level and will be added to:
- All HTTP JSON RPC requests
- WebSocket connection handshakes (initial HTTP upgrade request)
NOTE: Custom headers are supported for all connection types except gRPC connections.
==== Configuration
Custom headers are specified using the `custom-headers` parameter in your upstream configuration:
[source,yaml]
----
version: v1
upstreams:
- id: my-ethereum-node
chain: ethereum
custom-headers:
X-API-Key: "your-api-key-here"
X-Custom-Header: "custom-value"
Authorization: "Bearer your-token"
connection:
generic:
rpc:
url: "https://api.example.com/rpc"
ws:
url: "wss://api.example.com/ws"
----
=== Bitcoin Methods
.By default an ethereum upstream allows call to the following JSON RPC methods: