Outgoing traffic omits Titanium proxy
Hello,
Our project set up for tests requires using a custom proxy service with Titanium.Web.Proxy to work like a Fiddler autoresponder to specified requests with the specified responses, and it looks like outgoing traffic never hits that proxy.
We have a standalone version of the proxy with an executable and tried to run it as one of the steps in TeamCity, we tried launching it separately to TeamCity just as the tests are about to kick in, and we also have a .bat script that runs everything in one bundle. Neither solution seems to work. The script works fine on its own on the machine, so we figured it has to come down to the agetn's environment. How would you recommend to have a proxy like that be run? Anything that has to be configured agent-side?
We're on
Windows Server 2016 and TeamCity is set up on a system account, with the agent being on the same machine.
If this helps, when the proxy runs, this is the setup output:
Set endpoint at Ip 0.0.0.0 and port: 55528 as System HTTP Proxy
Set endpoint at Ip 0.0.0.0 and port: 55528 as System HTTPS Proxy
2018-01-22 11:00:35.8707 | INFO | Project.Proxy.Titanium.ProxyServer | Proxy server successfully registered on port 55528
Any advise will be greatly appreciated.
Please sign in to leave a comment.
Hi Kamil,
TeamCity runs on a JVM, so the JVM must be aware of the proxy settings. If the connection happens during a build, then you will need to configure the agents to use that proxy. Information on setting it up can be found here: https://confluence.jetbrains.com/pages/viewpage.action?pageId=74845225#HowTo...-ConfigureTeamCitytoUseProxyServerforOutgoingConnections
Hi Denis,
Thanks for the answer. However, it doesn't seem to work. The proxy is on the same machine as the server and agent (so server, agent and proxy are on the same computer) and I tried pointing to different combinations of the ptoxyHost as either localhost, 127.0.0.1 or even 0.0.0.0 from the Titanium startup notification. I've found a note somewhere online that there is a bug in Java itself where proxying via localhost does not work. Would that be the case?
Will try using a different computer on the same network over the weekend to see if that helps anything.
Kamil
Hi Denis,
We finally got it to work on the agent with the teamcity.http.proxyHost and teamcity.http.proxyPort settings, and the agent itself proxies correctly now, but still the particular programs that are launched inside the build configuration do not proxy. Will adding http.proxyHost and http.proxyPort to the buildAgent.properties proxy traffic inside the agent? I'm not sure looking at the confluence entry.
Kamil
It depends. The build agent is a Java process. As such, you configure the proxy and the agent traffic is routed through it. The issue is, many build types spawn entirely new processes, which might or might not inherit the proxy configuration, as they might use their own connectivity rules. You can check with your build process whether new processes spawn and if so, how to configure those, as this usually varies from one application to another.
Thanks, makes sense. Luckily we got something in the end - we force a system proxy via system.net in the config files (https://stackoverflow.com/questions/1938990/c-sharp-connecting-through-proxy) which did the trick. Thanks for your help, I initially thought the agent or server can force traffic going from all processes to go through a proxy, so you helped look at alternatives.