sdk-golang icon indicating copy to clipboard operation
sdk-golang copied to clipboard

Adding router proxy support

Open cx-serhii-stanislavskyi opened this issue 5 months ago • 0 comments

Add Router Proxy Configuration from Environment Variables

This PR adds two new functions to improve router connectivity options:

Changes

  1. Added routerProxyFromEnvironment function

    • Enables automatic proxy configuration for router connections based on environment variables
    • Uses HTTPS_PROXY or HTTP_PROXY environment variables to determine proxy settings
    • Automatically applied when loading configuration from file via NewConfigFromFile()
  2. 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

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.

cx-serhii-stanislavskyi avatar Jun 18 '25 13:06 cx-serhii-stanislavskyi