---
title: "How to set up a proxy with TFS4JIRA Synchronizer"
canonical: "https://support.appfire.com/space/SUPPORT/153453709/How%20to%20set%20up%20a%20proxy%20with%20TFS4JIRA%20Synchronizer"
format: markdown
---
As mentioned in [https://appfire.atlassian.net/wiki/display/TFS4JIRA/TFS4JIRA+FAQ#TFS4JIRAFAQ-TFS4JIRASynchronizerrefusestoestablishconnectionbecauseofproxy.](https://appfire.atlassian.net/wiki/display/TFS4JIRA/TFS4JIRA+FAQ#TFS4JIRAFAQ-TFS4JIRASynchronizerrefusestoestablishconnectionbecauseofproxy.)  TFS4JIRA Synchronizer can be used with proxy. There are though additional settings that can be helpful. 

Default settings for  enabling proxy in Synchronizer are:

```
<defaultProxy useDefaultCredentials="false">
    <proxy usesystemdefault="true" proxyaddress="<proxy address>" bypassonlocal="true" />
</defaultProxy>
```

This line will have to be added to following section to the C:\inetpub\wwwroot\tfs-jira-synchronizer\Web.config (default location of web.config file) file, <u>just before <</u><u>[system.web](http://system.web)</u><u>></u>

Aside from those, there are multiple scenarios to cover

> Macro (toc)

##   
Adding proxy credentials

#### No-code solution

1. Add a value `useDefaultCredentials="true"` in `defaultProxy` tag   
`<defaultProxy enabled="true" useDefaultCredentials="true">`
2. Go to “Control Panel”\All Control Panel Items\Credential Manager >> Add a Generic Credential  
Internet or network address: `<yourProxyAddress>`  
User name: `<yourUsername>`  
Password: `<yourPassword>`

#### Code-involved solution

Create an assembly called *proxyPass.dll* with this class :

```csharp
namespace SomeNameSpace
{
    public class MyProxy : IWebProxy
    {
        public ICredentials Credentials
        {
            get { return new NetworkCredential("yourUsername", "yourPassword"); }
            set { }
        }

        public Uri GetProxy(Uri destination)
        {
            return new Uri("yourProxyAddress");
        }

        public bool IsBypassed(Uri host)
        {
            return false;
        }
    }
}
```

where `"yourUsername", "yourPassword"` and `"yourProxyAddress"` are your  username, password and proxy address.

Add this file to the bin directory of the TFS4JIRA application.

Add instead of previous settings this line:

```
<defaultProxy enabled="true" useDefaultCredentials="false">
  <module type = "SomeNameSpace.proxyPass, SomeAssembly" />
</defaultProxy>
```

## Forcing Synchronizer to not use proxy on some connections 

In the `<defaultProxy>` tag you will have to specify the `<bypasslist>`

```
<defaultProxy  
  enabled="True|False"  
  useDefaultCredentials="True|False">  
    <bypasslist>...</bypasslist>  
    <proxy>...</proxy>  
    <module>...</module>  
</defaultProxy>
```

an example of this kind of setting would look like that:

```
<configuration>  
  <system.net>  
    <defaultProxy>  
      <bypasslist>  
        <add address="[a-z]+\.spartez-software\.com$" />  
        <add address="192\.168\.\d{1,3}\.\d{1,3}" />  
      </bypasslist>  
    </defaultProxy>  
  </system.net>  
</configuration>  
```