-
Notifications
You must be signed in to change notification settings - Fork 27
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
MPX-24 - Support proxy CoAP #43
Open
SammyOina
wants to merge
11
commits into
absmach:main
Choose a base branch
from
SammyOina:uv-267-coap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
SammyOina
force-pushed
the
uv-267-coap
branch
from
October 13, 2023 10:46
51e3098
to
de524ee
Compare
Signed-off-by: SammyOina <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: SammyOina <[email protected]>
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 <[email protected]>
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 <[email protected]>
SammyOina
force-pushed
the
uv-267-coap
branch
from
October 22, 2023 20:25
f194d47
to
e071208
Compare
Signed-off-by: SammyOina <[email protected]>
- Fix import of context package - Fix variable naming in Proxy struct Signed-off-by: SammyOina <[email protected]>
…ement Signed-off-by: SammyOina <[email protected]>
dborovcanin
requested changes
Oct 24, 2023
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
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 [email protected]
What does this do?
cmd/main.go
andpkg/coap/coap.go
. This allows users to securely send CoAP messages and proxy them to a target server.LoadTLSCfg
function inpkg/tls/tls.go
to useos.ReadFile
instead 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