This pull request implements proxy support for Reddit requests within the ASFFreeGames plugin, addressing issues #75 and #76.
Users can now leverage proxies Reddit.com api specific connections, increasing flexibility for those utilizing proxy servers for Reddit interactions.
Changes:
New configuration options:
ASFFreeGamesOptions.cs: Added properties Proxy and RedditProxy to support proxy configuration for general and Reddit connections, respectively.
ASFFreeGamesOptionsLoader.cs: Updated to load proxy settings from configuration and environment variables. These settings are then merged to ensure all configurations are considered.
Refactored Reddit communication:
FreeGamesCommand.cs: Modified GetGames to utilize SimpleHttpClientFactory and its CreateForReddit method, enabling the use of the configured Reddit proxy.
RedditHelper.cs: Replaced WebBrowser usage with SimpleHttpClient for Reddit communication, allowing proxy support.
Benefits:
Increased flexibility for users who require proxy servers for Reddit interactions.
Improved code maintainability by utilizing SimpleHttpClient consistently.
Disclaimers/Bugs/Issues:
Potential Security Concern: Merging environment variables and configuration file settings for proxy information could lead to sensitive data (like proxy passwords) being unintentionally written to the JSON file. Consider implementing a mechanism to exclude sensitive data from being saved to the configuration file.
Potential for Future System.MissingMethodException: This change might introduce the possibility of encountering System.MissingMethodException errors in future ASF updates. Thorough testing and potential code updates may be required to mitigate this risk.
Testing:
Manual testing with various proxy configurations is recommended to ensure proper functionality.
Additional Notes:
Consider adding a note about potential limitations or specific proxy requirements (if applicable).
TO-DOs:
[ ] Update README to reflect the new proxy support functionality.
[ ] Create new issues for the identified security concern.
[ ] Conduct more comprehensive testing to ensure stability across various configurations.
This pull request implements proxy support for Reddit requests within the ASFFreeGames plugin, addressing issues #75 and #76.
Users can now leverage proxies Reddit.com api specific connections, increasing flexibility for those utilizing proxy servers for Reddit interactions.
Changes:
New configuration options:
ASFFreeGamesOptions.cs
: Added propertiesProxy
andRedditProxy
to support proxy configuration for general and Reddit connections, respectively.ASFFreeGamesOptionsLoader.cs
: Updated to load proxy settings from configuration and environment variables. These settings are then merged to ensure all configurations are considered.Refactored Reddit communication:
GetGames
to utilizeSimpleHttpClientFactory
and itsCreateForReddit
method, enabling the use of the configured Reddit proxy.WebBrowser
usage withSimpleHttpClient
for Reddit communication, allowing proxy support.Benefits:
SimpleHttpClient
consistently.Disclaimers/Bugs/Issues:
System.MissingMethodException
: This change might introduce the possibility of encounteringSystem.MissingMethodException
errors in future ASF updates. Thorough testing and potential code updates may be required to mitigate this risk.Testing:
Additional Notes:
TO-DOs: