Allow modifying websocket requests.#642
Allow modifying websocket requests.#642yatinmaan merged 1 commit intobytebeamio:mainfrom reitermarkus:aws-iot
Conversation
|
@reitermarkus can you check CI failures? Also I am not sure if the updated |
|
Added |
|
Added a |
|
Do you have any specific reason you chose to go with You could modify the request later (for re-connections etc.) via |
|
Well, I only need to set the auth/signature headers, so I don't want to also have to set all MQTT protocol-specific headers. Also, the AWS |
Yeah, I meant doing it such that
This one is a slight advantage. But it'll still be possible to do this with I see the niceties of this closure style API but for rumqttc at the moment passing in additional headers would be simpler and more in line with how rest of the API works (eg see the manual acks examples). |
|
That seems very unergonomic and unintuitive to use. I'd have to create an empty request with the URL I already passed to |
@reitermarkus Agreed, Iike I said
The better way to do it would be to just let the user set any additional headers they want to be sent along via an API like |
|
To get the headers I would still have to create a request, since signing is done on a fully formed request. There is no way to only get signature headers without a request in the first place. |
@reitermarkus Makes sense. That's the sort of stuff I was looking for when I asked:
Sorry for the delay and thanks for your contribution 🚀 |
|
@yatinmaan, could you release a new version with this included? Thanks. |
@swanandx ^^ |
|
thnx for the ping @yatinmaan ! We will release rumqttc this week @reitermarkus 💯 |
|
update: rumqttc v0.23.0 is released, which includes this change! |
I am trying to connect to an AWS IoT Shadow via MQTT and SigV4 but couldn't find any way to add additional headers to the request. This adds a way to modify the request before connecting.
Example usage:
Type of change
Checklist:
cargo fmtCHANGELOG.mdif its relevant of user of the library. If its not relevant mention why.