Skip to content

No support for request headers for WsProvider #751

Description

@rossbulat

We are experimenting with private RPC usage in local development, but there is currently no option to provide request headers to websocket connections, such as an auth token that an RPC proxy can use to authenticate requests.

Example of the sort of support envisaged under the hood of WsProvider:

import WebSocket from "ws";

const socket = new WebSocket("wss://api.example.com/socket", {
  headers: {
    Authorization: `Bearer ${process.env.API_TOKEN}`,
    "X-Client-ID": "example-client"
  }
});

In local development, where IP addresses change often, an auth token would be more suitable than having to continuously update IP address whitelists.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions