Closed
Conversation
51e3098 to
de524ee
Compare
Signed-off-by: SammyOina <sammyoina@gmail.com>
The commit refactors the CoAP configuration variables in the main.go file. It introduces new environment variables and updates the default values for the CoAP host, port, target host, target port, and DTLS settings. The refactoring aims to improve the clarity and consistency of the codebase. Signed-off-by: SammyOina <sammyoina@gmail.com>
The commit fixes an error in the loadConfig function where an invalid value was being passed for the envCoAPDTLS environment variable. The error message was also updated to reflect the correct variable name. This commit also adds a return statement in the handler function of the coap package to handle an error when retrieving the path from the request options. Additionally, it initializes the logger and address fields in the NewProxy function of the coap package. The changes ensure that the loadConfig function handles the correct environment variable and that the handler function in the coap package returns when an error occurs. The NewProxy function in the coap package now correctly initializes the logger and address fields. Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
The CoAP proxy handler had a bug where the path was not correctly extracted from the request options. This caused errors when trying to send the request to the target connection. This commit fixes the bug by correctly extracting the path and using it to make the request to the target connection. This commit also adds a new method, `observeUpstream`, to handle CoAP observe requests. This method extracts the path from the request options and sets up a callback function to handle incoming observe notifications from the target connection. The bug fix and new method improve the reliability and functionality of the CoAP proxy handler. Signed-off-by: SammyOina <sammyoina@gmail.com>
The CoapConfig struct in main.go has been refactored to improve code organization and readability. The struct now includes separate fields for host, port, DTLS, targetHost, and targetPort. This change allows for better configuration of CoAP settings. The code has been updated to reflect these changes. Signed-off-by: SammyOina <sammyoina@gmail.com>
f194d47 to
e071208
Compare
Signed-off-by: SammyOina <sammyoina@gmail.com>
- Fix import of context package - Fix variable naming in Proxy struct Signed-off-by: SammyOina <sammyoina@gmail.com>
…ement Signed-off-by: SammyOina <sammyoina@gmail.com>
dborovcanin
requested changes
Oct 24, 2023
Signed-off-by: SammyOina <sammyoina@gmail.com>
Signed-off-by: SammyOina <sammyoina@gmail.com>
Contributor
|
Replaced by https://github.com/absmach/mgate/pull/108. |
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
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.
Signed-off-by: SammyOina sammyoina@gmail.com
What does this do?
cmd/main.goandpkg/coap/coap.go. This allows users to securely send CoAP messages and proxy them to a target server.LoadTLSCfgfunction inpkg/tls/tls.goto useos.ReadFileinstead of the deprecatedioutil.ReadFile.Which issue(s) does this PR fix/relate to?
Resolves #24.
List any changes that modify/break current functionality
Have you included tests for your changes?
Did you document any new/modified functionality?
Notes