-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Proxy Configuration #544
base: main
Are you sure you want to change the base?
Conversation
this.proxyHost = '', | ||
this.proxyPort = '', | ||
this.proxyUsername, | ||
this.proxyPassword, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of arguments, proxy fields should be a separate model.
@@ -299,6 +299,11 @@ class CollectionStateNotifier | |||
substitutedHttpRequestModel, | |||
defaultUriScheme: defaultUriScheme, | |||
noSSL: noSSL, | |||
isProxyEnabled: ref.read(settingsProvider).isProxyEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass a single object for proxy settings or null.
ref.read(settingsProvider) is being done multiple times.
@@ -0,0 +1,54 @@ | |||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |||
import '../models/proxy_config.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is proxy_config.dart
code?
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import '../models/proxy_config.dart'; | ||
|
||
final proxyConfigProvider = StateNotifierProvider<ProxyNotifier, ProxyConfig>((ref) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the need of proxyConfigProvider?
historyRetentionPeriod: historyRetentionPeriod, | ||
workspaceFolderPath: workspaceFolderPath, | ||
isSSLDisabled: isSSLDisabled, | ||
state = SettingsModel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you removed copyWith
?
@@ -50,6 +51,75 @@ class SettingsPage extends ConsumerWidget { | |||
ref.read(settingsProvider.notifier).update(isDark: value); | |||
}, | |||
), | |||
// Proxy Settings Section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proxy settings should have its own modal dialog and model.
@@ -11,6 +11,36 @@ http.Client createHttpClientWithNoSSL() { | |||
return IOClient(ioClient); | |||
} | |||
|
|||
http.Client createHttpClientWithProxy( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clean code. A single custom client creation should be there for both ssl & proxy.
Apart from the above comments, testing is also missing. |
PR Description
This pull request implements a feature that allows users to configure and use a proxy for their HTTP requests within the API Dash application. The feature includes a user interface for inputting proxy settings, storing these settings, and applying them to HTTP requests made using the http package in Flutter.
Related Issues
Checklist
main
branch before making this PRflutter upgrade
and verify)flutter test
) and all tests are passingAdded/updated tests?
I have tested the proxy feature by running a squid proxy server in Python. Above I have attached the image proving that the proxy is working perfectly fine.
OS on which you have developed and tested the feature?