Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masonm/wiremock-dynamic-proxy
Wiremock extension to determine proxy URL from request
https://github.com/masonm/wiremock-dynamic-proxy
deprecated wiremock
Last synced: 17 days ago
JSON representation
Wiremock extension to determine proxy URL from request
- Host: GitHub
- URL: https://github.com/masonm/wiremock-dynamic-proxy
- Owner: MasonM
- License: mit
- Created: 2017-03-26T05:41:07.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T05:23:38.000Z (almost 8 years ago)
- Last Synced: 2024-11-15T09:50:02.331Z (3 months ago)
- Topics: deprecated, wiremock
- Language: Java
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
This is a deprecated Wiremock extension that allows dynamically determining the `proxyBaseURL` from a request header.
It's no longer necessary, since this functionality was added in Wiremock 2.6.0 with https://github.com/tomakehurst/wiremock/pull/641I'm keeping this around as an example of a simple Wiremock extension.
# Building
Run `gradle jar` to build the JAR, which will be placed in `build/libs/`.
# Example usage
Running standalone server:
```
java \
-cp wiremock-standalone.jar:wiremock-dynamic-proxy-0.1.jar \
com.github.tomakehurst.wiremock.standalone.WireMockServerRunner \
--extensions="com.github.masonm.wiremock.DynamicProxyTransformer"
```Creating a stub mapping where the "X-Dest" header from the request is used as the `proxyBaseUrl`:
```
curl -d '{
"request": {
"method": "GET",
"urlPattern": ".*"
},
"response": {
"transformers": ["dynamic-proxy"],
"transformerParameters": {
"headerName": "X-Dest"
}
}
}' http://localhost:8080/__admin/mappings
```