Add method for plugin to set HTTP headers #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi. This MR adds a method for plugins to set HTTP headers on connection.
Proposed changes
The function
generate_headers
is called every time a new websocket connection is initialized and the headers are added after headers set on the command line. The plugin can keep state and change the headers for every new connection (e.g. setX-Forwarded-For
to a new value, or update some token), which wasn't possible until now.What remains to be done
The diagram in the repository should be updated. It would be great if the source of the diagram was in the repository too with instructions on how to generate it. Could you share the source of the diagram please?
Before writing more docs I would like to hear your thoughts on the change. Thanks for the tool, it's great.