Skip to content

Commit d27e80c

Browse files
authored
Merge pull request #3387 from NativeScript/ggarabed/docs-update-configure-proxy
docs: update the configure proxy usage section
2 parents dd5dc44 + 1388cfd commit d27e80c

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

README.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The NativeScript CLI lets you create, build, and deploy [NativeScript][7]-based
1313
* [System Requirements](#system-requirements "The hardware and software requirements for setting up and working with the NativeScript CLI")
1414
* [Installation](#installation "How to configure and install the NativeScript CLI")
1515
* [Install the NativeScript CLI](#install-the-nativescript-cli)
16-
* [Configure Proxy Usage](#configure-proxy-usage)
16+
* [Configure Proxy Usage](#configure-proxy-settings)
1717
* [Quick Start](#quick-start "Get started with the NativeScript CLI")
1818
* [The Commands](#the-commands)
1919
* [Create Project](#create-project)
@@ -103,17 +103,47 @@ To check if your system is configured properly, run the following command.
103103
tns doctor
104104
```
105105

106-
## Configure Proxy Usage
106+
## Configure Proxy Settings
107107

108-
If you are working with the NativeScript CLI behind a web proxy, you might need to configure your proxy settings.
108+
If you are working with the NativeScript CLI behind a web proxy, you need to configure your proxy settings.
109109

110-
1. On your file system, locate the directory where the **nativescript** npm package is installed.
111-
1. In a text editor, open `config` → `config.json`.
112-
1. Set `USE_PROXY` to `true`.
113-
1. Set `PROXY_PORT`.
114-
1. Set `PROXY_HOSTNAME`.
110+
### Set Proxy Settings
115111

116-
> Make sure to preserve the quotation marks and commas as in the initial `config.json` file.
112+
```Shell
113+
tns proxy set <Url> <Username> <Password>
114+
```
115+
116+
#### Attributes
117+
118+
<details><summary><code>&lt;Url&gt;</code></summary>
119+
<strong>(Required)</strong> The full URL of the proxy. The <code>&lt;Url&gt;</code> attribute is required and if you do not provide it when running the command, the NativeScript CLI will prompt you to provide it. An example of a valid proxy URL is <code>http://127.0.0.1:8888</code>.</details>
120+
121+
<details><summary><code>&lt;Username&gt;</code> and <code>&lt;Password&gt;</code></summary>
122+
<strong>(Optional)</strong> The credentials for the proxy. The <code>&lt;Username&gt;</code> and <code>&lt;Password&gt;</code> attributes are optional, however, if you choose to provide them, you must provide both.</details>
123+
124+
#### Options
125+
126+
<details><summary><code>--insecure</code></summary>
127+
The <code>--insecure</code> flag allows you to perform insecure SSL connections and transfers. This option is useful when your proxy does not have a CA certificate or the certificate is no longer valid.</details>
128+
129+
#### Limitations
130+
131+
* You can provide the `<Username>` and `<Password>` attributes only on Windows systems.
132+
* Proxy settings for the npm and the Android Gradle need to be configured separately. For more information, see the following articles:
133+
* [Configure the npm proxy](https://docs.npmjs.com/misc/config#https-proxy)
134+
* [Configure the Android Gradle proxy](https://docs.gradle.org/3.3/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy)
135+
136+
### Display Current Proxy Settings
137+
138+
```Shell
139+
tns proxy
140+
```
141+
142+
### Clear Proxy Settings
143+
144+
```Shell
145+
tns proxy clear
146+
```
117147

118148
[Back to Top][1]
119149

0 commit comments

Comments
 (0)