mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Partial proxy stub mapping #479
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ThokerWD on GitHub (Jan 11, 2023).
Is it possible to define a proxy stub mapping similar to the following one ?
So that requests matching this template get proxied to "http://otherhost.com" and other responses get matched by my local logic ?
@StefH commented on GitHub (Jan 11, 2023):
You need two mappings.
This example should work (in case your real host is named "realhost.com")
@ThokerWD commented on GitHub (Jan 12, 2023):
Thanks for the quick reply @StefH . Unfortunately I can't make this work together with client certificate authentication for a https server.
When this is configured under
ProxyAndRecordSettings, then the authentication works fine, but then all requests get proxied to the configured URL.Is there a possibility to configure a ClientCertificate together with a ProxyUrl ?
Example:
@StefH commented on GitHub (Jan 12, 2023):
In your case, do not define a global proxy, but only in the mappings.
Like here:
https://github.com/WireMock-Net/WireMock.Net/wiki/Proxying#proxyintercept
@ThokerWD commented on GitHub (Jan 12, 2023):
Thank you, this way I can also specify a certificate for this proxy. I think this is currently only supported in code and not in json though.