-
-
Notifications
You must be signed in to change notification settings - Fork 197
Add command for setting proxy #2660
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
Conversation
@@ -20,4 +20,7 @@ Command | Description | |||
[error-reporting](error-reporting.html) | Configures anonymous error reporting for the NativeScript CLI. | |||
[help](help.html) | Lists the available commands or shows information about the selected command. | |||
[doctor](doctor.html) | Checks your system for configuration problems which might prevent the NativeScript CLI from working properly. | |||
[proxy](proxy.html) | Displays proxy settings. | |||
[proxy clear](proxy-clear.html) | Clears proxy settings. | |||
[proxy set](proxy-set.html) | Sets proxy settings. |
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.
the proxy get
or proxy list
command is not documented anywhere?
I guess it's the "tns proxy" but in this way, how will the user view the documentation of the proxy command?
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.
there's no proxy list command - the default command is proxy get
, so in case you write just tns proxy
it will execute proxy get
command.
@@ -20,4 +20,7 @@ Command | Description | |||
[error-reporting](error-reporting.html) | Configures anonymous error reporting for the NativeScript CLI. | |||
[help](help.html) | Lists the available commands or shows information about the selected command. | |||
[doctor](doctor.html) | Checks your system for configuration problems which might prevent the NativeScript CLI from working properly. | |||
[proxy](proxy.html) | Displays proxy settings. | |||
[proxy clear](proxy-clear.html) | Clears proxy settings. | |||
[proxy set](proxy-set.html) | Sets proxy settings. |
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.
How do I update a proxy to be enabled/disabled? Can I do it via command or by manually editing the config.json?
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.
You either set it or clear it.
@@ -6,7 +6,6 @@ export class Configuration extends ConfigBase implements IConfiguration { // Use | |||
CI_LOGGER = false; | |||
DEBUG = false; | |||
TYPESCRIPT_COMPILER_OPTIONS = {}; | |||
USE_PROXY = false; |
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.
do we consider having a way to keep this functionality of enable/disable proxy?
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.
I believe a short article describing what is using a proxy good for and how to set it up, would be helpful for the users.
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.
The functionality is introduced as command, so there's no need to manually edit any file. When you use the command, it will create required file (not the config.json ), so there's no need for the user to do anything else - just use the commands.
Where do you think is the appropriate place for such an article?
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.
Better ask @PetyaSotirova
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.
The functionality is introduced as command, so there's no need to manually edit any file.
I ment will we still have a way to enable/disable the proxy in any way through the newly created command or the only way would be to clear it and loosing all previous settings?
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.
There's no way to disable it - set it or clear it. The problem with disabling is that the credentials will be kept when they are not used, which is somehow a security risk. That's why we've decided to skip the disabling - set or clear only.
317d816
to
ba3143c
Compare
At the moment users can set proxy by manually editing the file `<cli installation dir>/config/config.json`. However this has two issues: - the proxy does not support authentication - if you install newer version of CLI, the file is overwritten, so you have to set it again. Fix both issues by: - creating command that sets the proxy. - (currently) for Windows introduce support for authenticated proxy - username and password are stored via Windows Credential Manager API functions. Expected workflow: `$ tns <command that makes http request>` Your proxy requires a username and password. You can run tns proxy set <hostname> <port> <username> <password> In order to supply NativeScript with the credentials needed. `$ tns proxy set 127.0.0.1 8888 user pass` Sucessfully setup proxy. `$ tns proxy get` Hostname: 127.0.0.1 Port: 8888 Proxy is Enabled `$ tns proxy clear` Sucessfully cleared proxy. `$ tns proxy get` No proxy set
ba3143c
to
ae061dd
Compare
At the moment users can set proxy by manually editing the file
<cli installation dir>/config/config.json
.However this has two issues:
Fix both issues by:
Expected workflow:
$ tns <command that makes http request>
Your proxy requires a username and password. You can run
tns proxy set
In order to supply NativeScript with the credentials needed.
$ tns proxy set 127.0.0.1 8888 user pass
Sucessfully setup proxy.
$ tns proxy get
Hostname: 127.0.0.1
Port: 8888
Proxy is Enabled
$ tns proxy clear
Sucessfully cleared proxy.
$ tns proxy get
No proxy set