CustomProxy constructor
A class that manages custom proxy settings for Flutter applications.
This class provides functionality to set up and manage a proxy server configuration, including the ability to enable/disable the proxy and handle custom certificates.
Example usage:
final proxy = CustomProxy(ipAddress: '192.168.1.1', port: 8080);
proxy.enable(); // Enables the proxy
proxy.disable(); // Disables the proxy
You can also create a proxy instance from a string:
final proxy = CustomProxy.fromString(proxy: '192.168.1.1:8080');
The class supports:
- Setting custom IP address and port
- Enabling/disabling proxy settings
- Optional bad certificate handling
- String representation of proxy settings
Note: When allowBadCertificates is set to true, it may pose security risks and should be used with caution, especially in production environments.
Implementation
const CustomProxy({
required this.ipAddress,
this.port,
this.allowBadCertificates = false,
});