sdk-golang
sdk-golang copied to clipboard
Adding router proxy support
Add Router Proxy Configuration from Environment Variables
This PR adds two new functions to improve router connectivity options:
Changes
-
Added
routerProxyFromEnvironmentfunction- Enables automatic proxy configuration for router connections based on environment variables
- Uses
HTTPS_PROXYorHTTP_PROXYenvironment variables to determine proxy settings - Automatically applied when loading configuration from file via
NewConfigFromFile()
-
Added
parseTLS(raw string)helper function- Supports router URLs with the format
tls:router.example.com:443 - Converts
tls:scheme URLs to proper HTTPS URLs for processing - Enables more flexible router addressing options
- Supports router URLs with the format
Use Cases
- Simplifies deployment in environments where direct connections are restricted and proxies are required
- Allows for consistent proxy configuration across applications using environment variables
- Supports more intuitive TLS connection specification with the
tls:URL format
These changes maintain backward compatibility while adding flexibility for different network configurations.