Custom websocket request headers
Hi,
I was wondering if there was a reason for which the requestHeaders for a websocket connection are not configurable through the options builder. From what I see all the code is there, and would only require an overload to WithWebSocketServer in MqttClientOptionsBuilder such as :
public MqttClientOptionsBuilder WithWebSocketServer(string uri, IDictionary<string, string> requestHeaders)
{
_webSocketOptions = new MqttClientWebSocketOptions
{
Uri = uri,
RequestHeaders = requestHeaders
};
return this;
}
I was asking because when using an AWS custom authorizer for validating connections, it needs some information passed through headers.
I can fork and start a pull request if you wish.
Thanks for your help, Charles
Hi, yes please create a pull request. Please take care for backward compatibility when adding parameters to functions of the options builder.
This was not added because no one ever asked for it 😄
Best regards Christian