parautenbach / TeamCity-HipChat-Notifier

TeamCity HipChat Notifier for sending build server notifications to HipChat.
Other
59 stars 31 forks source link

Http proxy configuration support #46

Closed kringol closed 9 years ago

kringol commented 9 years ago

Hi,

Is it possible to add configuration and connection support for using http proxy to connect to the hipchat servers?

I tried with teamcity own configuration (https://confluence.jetbrains.com/display/TCD9/How+To...#HowTo...-ConfigureTeamCitytoUseProxyServerforOutgoingConnections) But seems that the plugin uses Apache HttpClient to connect. And for that to use a proxy, a Route must be added when creating the client http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e475

It would be awesome if the HipChatNotifier plugin can have an independent http proxy configuration from the settings on the admin ui. So it's easier to enable a proxy just for this plugin

Thanks and great plugin!

parautenbach commented 9 years ago

Thank you the feedback! Adding proxy support is certainly a good idea.

parautenbach commented 9 years ago

The latest version, v0.9.0 now uses TeamCity's configured proxy support automatically. Let me how it works for you!

kringol commented 7 years ago

Sorry for the 1year late comeback. I just tried this now. Sorry to say it doesn't seem to be working. Maybe due to the fact that hipchat api is https, and the proxy config you are reading and supplying is only the one for http.

I believe using the http system default config would help

https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e485 or http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/SystemDefaultHttpClient.html

logs

[2016-09-28 07:34:05,437] INFO - hatsthatlight.teamcity.hipchat - Proxy configuration detected [2016-09-28 07:34:05,437] DEBUG - hatsthatlight.teamcity.hipchat - Host: mylocalproxy [2016-09-28 07:34:05,439] INFO - hatsthatlight.teamcity.hipchat - Proxy configured: mylocalproxy:9501 [2016-09-28 07:34:06,292] ERROR - hatsthatlight.teamcity.hipchat - Could not retrieve emoticons: 403 Forbidden