Skip to content

Support for additional HTTP headers in Websocket connection #856

@rafaelubal

Description

@rafaelubal

Hi,

I'm trying to add additional authentication headers in the initial HTTP connection request, but using option wsOptions does not seem to add additional headers:

client = mqtt.connect(url, {
  clientId: client_id,
  wsOptions: {
    headers: {
      'My-Header': 'my_value'
    }
  }
});

If there is currently a way to do this, it'd be great if the documentation explicitly stated it. If not, I'd greatly appreciate support for this feature. Thanks a lot!

Rafael

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions