Skip to content
This repository
Browse code

document how to configure groovy-wslite

  • Loading branch information...
commit bd7c43d9120c75f7d0a14d5dfd31351e8a1adc75 1 parent 6d7371e
Rob Fletcher authored

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 src/docs/index.md
10 src/docs/index.md
Source Rendered
@@ -184,6 +184,15 @@ _HTTPBuilder_ also includes a [_HttpURLClient_][httpurlclient] class which needs
184 184 ProxyHost proxy = new ProxyHost("localhost", recorder.getProxyPort());
185 185 client.getHostConfiguration().setProxyHost(proxy);
186 186
  187 +### WSLite
  188 +
  189 +The [groovy-wslite][wslite] library is not aware of the default JVM proxy settings so the proxy needs to be explicitly configured.
  190 +
  191 + def client = new RESTClient(targetUrl)
  192 + def proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress('localhost', recorder.proxyPort))
  193 +
  194 + def response = client.get(path: '/', proxy: proxy)
  195 +
187 196 ## HTTPS
188 197
189 198 As of version 1.1 Betamax can proxy HTTPS traffic as well as HTTP. Because Betamax needs to be able to read the content of the request and response it is not actually a valid secure proxy. Betamax will only work if the certificate chain is broken.
@@ -336,4 +345,5 @@ The documentation is built with [Jekyll][jekyll], [Twitter Bootstrap](http://twi
336 345 [twitterratelimit]:https://dev.twitter.com/docs/rate-limiting
337 346 [webservices]:http://en.wikipedia.org/wiki/Web_service
338 347 [vcr]:http://relishapp.com/myronmarston/vcr
  348 +[wslite]:https://github.com/jwagenleitner/groovy-wslite
339 349 [yaml]:http://yaml.org/

0 comments on commit bd7c43d

Please sign in to comment.
Something went wrong with that request. Please try again.