Skip to content

Using a proxy server

netwolfuk edited this page Oct 9, 2014 · 12 revisions

The tcWebHooks plugin can be instructed to use a proxy server by adding a new element to TeamCity's main-config.xml file. If a proxy configuration is present, tcWebHooks will use for all its webhook requests.

If a proxy has been configured, it is posible to tell the plugin not to use a proxy for certain URLs by adding them to the config as <noproxy> child elements.

For more infomation about configuring TeamCity and to find the location of where the main-config.xml file is located, please see https://confluence.jetbrains.com/display/TCD8/TeamCity+Data+Directory

Typical Proxy configuration

    <?xml version="1.0" encoding="UTF-8"?>
    <server>
      <webhooks>
        <proxy host="myproxy.mycompany.com" port="8080" username="proxy_username" password="proxy_password">
          <noproxy url=".mycompany.com" />
          <noproxy url="192.168.0." />
        </proxy>
      </webhooks>
    </server>

No configuration

If there is no <webhooks> element present in the main-config.xml, the tcWebHooks plugin will not attempt to use a proxy when issuing webhook requests and will expect to be able to make a direct connection to the URL configured in the webhook.

Minimal configuration

The only required parameters on the proxy XML element are host and port. The noproxy child element is optional. Therefore, only the following are required.

    <?xml version="1.0" encoding="UTF-8"?>
    <server>
      <webhooks>
        <proxy host="myproxy.mycompany.com" port="8080"/>
      </webhooks>
    </server>