Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what can i do to set proxy to connect the broker ? #478

Closed
yuqitao opened this issue Jul 5, 2017 · 6 comments
Closed

what can i do to set proxy to connect the broker ? #478

yuqitao opened this issue Jul 5, 2017 · 6 comments

Comments

@yuqitao
Copy link

yuqitao commented Jul 5, 2017

when i run pact-work-shop , on step 13 , run ./gradlew :consumer:check , there is an error : time out .
i find the project need to connect the broker . i know i must set proxy . what can i do to set proxy to connect the broker ?

@uglyog
Copy link
Member

uglyog commented Jul 6, 2017

Ah, yes, damn proxies. There is no current way of configuring the proxy directly.

There are system properties, but the way the HTTP client is setup needs to change to use those.

@yuqitao
Copy link
Author

yuqitao commented Jul 6, 2017

OK,thank you

@yuqitao yuqitao closed this as completed Jul 6, 2017
@uglyog uglyog reopened this Jul 6, 2017
@uglyog
Copy link
Member

uglyog commented Jul 6, 2017

I'm leaving the issue open, as this needs to be fixed so you can use a proxy.

@yuqitao
Copy link
Author

yuqitao commented Jul 6, 2017

package au.com.dius.pact.provider.broker
HalClient.groovy

private newHttpClient() {
http = new RESTClient(baseUrl)
http.parser.'application/hal+json' = http.parser.'application/json'
http.handler.'404' = {
throw new NotFoundHalResponse("404 Not Found response from the pact broker (URL: '${baseUrl}'," +
" LINK: '${lastUrl}')")
}
http
}

can i set proxy here , use like : http.setProxy()

@uglyog
Copy link
Member

uglyog commented Jul 6, 2017

Yes, that is one way to do it. I was hoping to use the proxy system properties (http.proxyHost, http.proxyPort) as defined here: https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/client/SystemDefaultHttpClient.html

@YOU54F
Copy link
Member

YOU54F commented May 25, 2022

Can this be closed now due to #1491 being merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants