Skip to content

Feature: Add ws_connection_headers parameter to NatsBroker #2683

@mihail8531

Description

@mihail8531

Is your feature request related to a problem? Please describe.
In nats-py 2.12.0, the ws_connection_headers parameter was added for sending headers when connecting via WS.

Describe the solution you'd like
Add ws_connection_headers to NatsBroker

Feature code example

from faststream.nats import NatsBroker

custom_headers = {
    "Authorization": ["Bearer MySecretToken"],
    "X-Client-ID": ["my-client-123"],
    "Accept": ["application/json", "text/plain"]
}

broker = NatsBroker(
    "ws://localhost:4222",
    ws_connection_headers=custom_headers
)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    NATSIssues related to `faststream.nats` module and NATS broker featuresenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions