Skip to content

Commit

Permalink
Add a note about the REST Client's dev mode proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Aug 1, 2024
1 parent 5a42a77 commit 64830e7
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/src/main/asciidoc/rest-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,34 @@ quarkus.rest-client.my-client.url=...

NOTE: MicroProfile REST Client specification does not allow setting proxy credentials. In order to specify proxy user and proxy password programmatically, you need to cast your `RestClientBuilder` to `RestClientBuilderImpl`.

Check warning on line 1658 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Be concise: use 'to' rather than' rather than 'In order to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Be concise: use 'to' rather than' rather than 'In order to'.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1658, "column": 88}}}, "severity": "INFO"}

Check warning on line 1658 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'to' rather than 'In order to' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'to' rather than 'In order to' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1658, "column": 88}}}, "severity": "WARNING"}

Check warning on line 1658 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1658, "column": 160}}}, "severity": "INFO"}

=== Local proxy for dev mode

Check warning on line 1660 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1660, "column": 20}}}, "severity": "INFO"}

When using the REST Client in dev mode, Quarkus has the ability to stand up a pass-through proxy which can be used as a target for Wireshark (or similar tools)

Check warning on line 1662 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'Wireshark'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'Wireshark'?", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1662, "column": 121}}}, "severity": "WARNING"}

Check warning on line 1662 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Be concise: use 'to' rather than' rather than 'in order to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Be concise: use 'to' rather than' rather than 'in order to'.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1662, "column": 150}}}, "severity": "INFO"}

Check warning on line 1662 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'to' rather than 'in order to' unless updating existing content that uses the term. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'to' rather than 'in order to' unless updating existing content that uses the term.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1662, "column": 150}}}, "severity": "WARNING"}
in order to capture all the traffic originating from the REST Client (this really makes sense when the REST Client is used against HTTPS services)

To enable this feature, all that needs to be done is set the `enable-local-proxy` configuration option for the configKey corresponding to the client for which proxying is desired.

Check warning on line 1665 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'needs to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'needs to'.", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1665, "column": 23}}}, "severity": "INFO"}

Check warning on line 1665 in docs/src/main/asciidoc/rest-client.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'proxying'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'proxying'?", "location": {"path": "docs/src/main/asciidoc/rest-client.adoc", "range": {"start": {"line": 1665, "column": 149}}}, "severity": "WARNING"}
For example:

[source,properties]
----
quarkus.rest-client.my-client.enable-local-proxy=true
----

When a REST Client does not use a config key (for example when it is created programmatically via `QuarkusRestClientBuilder`) then the class name can be used instead.
For example:

[source,properties]
----
quarkus.rest-client."org.acme.SomeClient".enable-local-proxy=true
----

The port the proxy is listening can be found in startup logs. An example entry is:

[source]
----
Started HTTP proxy server on http://localhost:38227 for REST Client 'org.acme.SomeClient'
----

== Package and run the application

Run the application with:
Expand Down

0 comments on commit 64830e7

Please sign in to comment.