-
Notifications
You must be signed in to change notification settings - Fork 29
UV-267 - WS proxy support #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rodneyosodo
requested changes
Oct 4, 2023
Signed-off-by: SammyOina <sammyoina@gmail.com>
The websocket package has been refactored to improve code organization and maintainability. The following changes have been made: - The package import path has been updated to "github.com/mainflux/mproxy/pkg/websockets". - Unused constants and variables related to the websocket configuration have been removed. These changes improve the clarity and readability of the codebase. Signed-off-by: SammyOina <sammyoina@gmail.com>
This commit fixes the authorization handling in the websockets handler. Previously, the code was assuming that the authorization token would always be provided as a query parameter. However, this is not always the case, as the token can also be provided in the `Authorization` header. To fix this issue, the code now checks both the query parameter and the header for the authorization token. If the token is not found in either of these locations, an `ErrAuthorizationNotSet` error is returned. This change ensures that the websockets handler correctly handles authorization and provides a more robust and secure implementation. Signed-off-by: SammyOina <sammyoina@gmail.com>
Import the missing package "golang.org/x/sync/errgroup" to fix the import error in websockets.go file. Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
The commit refactors the configuration struct in the main.go file to improve readability and maintainability. The struct fields (httpConfig, mqttConfig, wsMQTTConfig, wsConfig, and logLevel) are now properly aligned and indented. Additionally, the commit updates the logging message for starting the encrypted WebSocket proxy on port cfg.wsMQTTConfig.wssPort. The previous message incorrectly referenced cfg.mqttWssPort. This commit follows the best practices for writing commit messages and provides a clear and concise summary of the changes made in the commit. Signed-off-by: SammyOina <sammyoina@gmail.com>
The variable "target" in the Proxy.Handler() function was assigned using an incorrect format string. This commit fixes the issue by updating the format string to the correct value. Summary: - Fix incorrect variable assignment in Proxy.Handler() Body: - The variable "target" in the Proxy.Handler() function was assigned using an incorrect format string. This commit fixes the issue by updating the format string to the correct value. Signed-off-by: SammyOina <sammyoina@gmail.com>
drasko
approved these changes
Oct 22, 2023
Contributor
drasko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request title should be
MF-XXX - descriptionorNOISSUE - descriptionwhere XXX is ID of issue that this PR relate to.Please review the CONTRIBUTING.md file for detailed contributing guidelines.
What does this do?
Which issue(s) does this PR fix/relate to?
Put here
Resolves #XXXto auto-close the issue that your PR fixes (if such)List any changes that modify/break current functionality
Have you included tests for your changes?
Did you document any new/modified functionality?
Notes