Overview
Networking Features:- Proxy Support - HTTP, SOCKS5, and environment-based proxy configuration
- Connection Pooling - Optimize network resources and performance
- Custom Headers - Add authentication, organization, or tracking headers
- Timeout Control - Fine-grained timeout configuration per provider
- Retry Logic - Exponential backoff with configurable retry policies
- Base URL Override - Custom endpoints for enterprise deployments
- Better Performance - Connection reuse and pooling
- Enterprise Ready - Proxy and firewall compatibility
- Fault Tolerance - Automatic retry with backoff strategies
- Flexible Deployment - Custom endpoints and headers
Basic Network Configuration
Default Network Settings
Go Package Usage| Field | Type | Description | Default |
|---|---|---|---|
BaseURL | string | Custom provider endpoint | Provider default |
ExtraHeaders | map[string]string | Additional HTTP headers | {} |
DefaultRequestTimeoutInSeconds | int | Request timeout | 30 |
MaxRetries | int | Retry attempts | 0 |
RetryBackoffInitial | time.Duration | Initial retry delay | 500ms |
RetryBackoffMax | time.Duration | Maximum retry delay | 5s |
config.json):
Proxy Configuration
HTTP Proxy
Go Package - HTTP Proxy| Field | Type | Description | Required |
|---|---|---|---|
Type | ProxyType | Proxy type (http/socks5/env) | ✅ |
URL | string | Proxy server URL | ✅ |
Username | string | Proxy authentication user | ❌ |
Password | string | Proxy authentication pass | ❌ |
SOCKS5 Proxy
Go Package - SOCKS5 ProxyEnvironment-Based Proxy
Go Package - Environment ProxyTimeout & Retry Configuration
Basic Retry Logic
Go Package - Retry ConfigurationProvider-Specific Timeouts
Go Package - Provider-Specific TimeoutsCustom Headers
Authentication Headers
Go Package - Custom HeadersTracking and Monitoring Headers
Go Package - Monitoring HeadersEnterprise Configuration
Corporate Network Setup
Enterprise Network Configuration Go Package - Enterprise Setup:Multi-Region Configuration
🌍 Multi-Region Setup Go Package - Regional Endpoints:Best Practices
Timeout Strategy
Recommended Timeout Values| Use Case | Timeout | Max Retries | Initial Backoff |
|---|---|---|---|
| Interactive Chat | 30s | 2 | 500ms |
| Batch Processing | 120s | 5 | 1s |
| Real-time API | 15s | 1 | 250ms |
| Background Jobs | 300s | 3 | 2s |
Proxy Best Practices
Proxy Configuration Tips Corporate Environment:Next Steps
| Task | Documentation |
|---|---|
| Configure API keys | Key Management |
| Set up providers | Providers |
| Optimize performance | Memory Management |
| Handle network errors | Error Handling |
Tip: Always test your proxy and timeout settings in a staging environment before deploying to production.