aws/aws-iot-device-sdk-python-v2

Proxy settings included in basic discovery script

MaxProfit opened this issue · 5 comments

Describe the feature

I see that in the analogous Java SDK V2 that there is an option for including proxy host and port, I don't see this option in the Python SDK sample. Is there a way to add this? I'm trying to figure out how to configure proxy.

Use Case

I don't fully understand the necessary steps to setup a proxy for greengrass discovery, and including this in the sample would allow me to reverse engineer how to do it for my own solution.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

main branch

Environment details (OS name and version, etc.)

N/A

Thank you for making this request! Currently a small code change is needed to add proxy support to the Greengrass Discovery client in Python V2 so it has the same options as Java V2. I have a PR open for this that will add this support and update the sample: #377

Are you sure it's just that simple? I'm looking at the difference and I see and have modified the mqtt_connection_builder.mtls_from_path function parameters to include the proxy, but I think I'm getting my script stuck even before that. My script gets stuck on the Discovery run. I looked at the Java and compared it to the Python and it looks like you can attach a proxyconfig to the Java DiscoveryClient but you can't attach a proxyconfig to the Python DiscoveryClient instantiation.

The change doesn't modify the mqtt_connection_builder but allows passing a HttpProxyOptions to the DiscoveryClient. The important part of the change is line 42 of greengrass_discovery.py, and then the other changes to greengrass_discovery.py to allow for passing the proxy options as an argument. The change allows for setting the proxy settings in the underlying HTTP connection for Greengrass Discovery, which should make it function just like in Java. 🙂

I'm going to close this issue since proxy support was added to DiscoveryClient, but if you have further issues and/or questions, please do not hesitate to reach out and/or make a new GitHub issue.

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.