共用方式為


Proxy command (Team Foundation Version Control)

TFS 2018

Visual Studio 2019 | Visual Studio 2022

The Team Foundation Version Control (TFVC) tf proxy command configures your client computer to use a proxy server. The command adds, deletes, and lists proxy records about the location and availability of one or more proxy servers within your deployment, including any remote sites.

Prerequisites

To use the proxy command to configure a client computer, you must be a member of the User security group on the local computer. To use the proxy command to work with proxy records, you must have the AdminConfiguration permission. For more information, see Security namespace and permission reference.

Syntax

tf proxy ([/configure [Url]) [/collection:TeamProjectCollectionUrl]
[/login:UserName,[Password]]
tf proxy /add Url [/name:Name] [/site:SiteName] 
[/description:Description] [/default:(global|site|all)] 
[/collection:TeamProjectCollectionUrl] [/login:UserName,[Password]] 
tf proxy /delete Url [/collection:TeamProjectCollectionUrl]
[/login:UserName,[Password]] 
tf proxy /list [Url1 Yrl2 ...] 
[/collection:TeamProjectCollectionUrl] [/login:UserName,[Password]]
tf proxy /enabled:(true|false)

Parameters

Arguments

Argument

Description

<url>

Identifies the proxy server. You must use the format http://<proxyServerName>:<proxyPortNumber>, where proxyServerName is the name of the proxy server and proxyPortNumber is the assigned listening port, for example http://server:8081.

<TeamProjectCollectionUrl>

Identifies the project collection. You must use the format http://<ApplicationTierServerName>:<PortNumber>/<Directory>/<CollectionName>. where ApplicationTierServerName is the name of the application-tier server, PortNumber is the assigned listening port, and Directory/CollectionName are the names of the directory and the collection. For example, http://server:8080/tfs/newcollection1.

<username>

Provides a value to the /login option. You can specify a user name value as either DOMAIN\username or username.

<password>

Provides a password for the user name.

Options

Option

Description

/configure

Configures your client computer to use a proxy server.

/collection

Specifies the project collection.

/login

Specifies the user name and password to authenticate.

/add

Adds a proxy record to Azure DevOps Server about the location and availability of proxy servers on your network.

/name

Associates a name with a proxy record.

/site

Associates an Active Directory domain with a proxy record.

/description

Specifies a description of the proxy record.

/default

Specifies the scope of the proxy record. You can specify one of the following values:

  • global
  • site
  • all

If you add a proxy record with the default set to global, the first time a developer does a get operation, Azure DevOps Server redirects that request to the proxy that the global record specifies. If you add a proxy record with the default set to site, the first time a developer from within the specified Active Directory domain does a get operation, Azure DevOps Server redirects that request to the proxy that the record associated with the site specifies.

/delete

Deletes a proxy record from Azure DevOps Server.

/list

Lists proxy records in Azure DevOps server.

/enabled

Enables or disables a proxy.

  • true
  • false

Remarks

The proxy command has two purposes, and each purpose is aimed at a different type of user.

As a developer, you can use the proxy command to configure your client to use a proxy server or to override the network defaults for a proxy server. This task is similar to configuring Azure DevOps to use a proxy.

As a network administrator, you can use the proxy command to add and manage records about the location of various proxy servers within your deployment of Azure DevOps Server. You can use these records to help developers configure their workstations to use a proxy. If you define a global proxy, Azure DevOps Server can automatically redirect developers to use it.

If you have a complex network topology with multiple Active Directory domains in various geographic locations, you can set up multiple records and associate each record with a particular domain. These records can then help you automatically direct developers from each geographical location to the appropriate proxy for their location.

For more information on how to use the tf command-line utility, see Use Team Foundation version control commands.

Examples

The following example automatically detects and configures a client computer to use a proxy, if a proxy record has been established:

c:\projects>tf proxy /configure

The following example overrides any proxy records on Azure DevOps Server and configures a client computer to use a specified proxy:

c:\projects>tf proxy /configure <Url>

The following example adds a global record to Azure DevOps Server about the availability of the server proxy. The first time that a developer does a get operation, Azure DevOps Server redirects all requests from that developer to the specified proxy.

c:\projects>tf proxy /add http://server:8081 /default:global /collection:http://tfsserver:8080/

The following example adds a site record to Azure DevOps Server for developers in an Active Directory domain, which is named corp, to use this server proxy. The first time that a developer from that domain does a get operation, Azure DevOps Server redirects all requests from that developer to the specified proxy.

c:\projects>tf proxy /add http://server:8081 /default:site /site:corp /collection:http://tfsserver:8080/