API to record stub while proxying #236

Closed
opened 2025-12-29 08:24:31 +01:00 by adam · 5 comments
Owner

Originally created by @RajnishChhn on GitHub (Dec 18, 2019).

I have been searching for long as to how to record stubs while proxying. I understand that there is one method in which we can pass ProxyAndRecordSettings and tell the server which url needs to be proxied and recorded while starting the FluentMockServer.
Is there any admin api or any other method using which i can give a url to be proxied and recorded?
Something like (from wireMock):
POST /__admin/recordings/start
{
"targetBaseUrl": "http://example.mocklab.io"
}
I have looked through the wiki and couldn't find one. Please forgive me if i have overlooked anything.

Originally created by @RajnishChhn on GitHub (Dec 18, 2019). I have been searching for long as to how to record stubs while proxying. I understand that there is one method in which we can pass ProxyAndRecordSettings and tell the server which url needs to be proxied and recorded while starting the FluentMockServer. Is there any admin api or any other method using which i can give a url to be proxied and recorded? Something like (from wireMock): POST /__admin/recordings/start { "targetBaseUrl": "http://example.mocklab.io" } I have looked through the wiki and couldn't find one. Please forgive me if i have overlooked anything.
adam added the question label 2025-12-29 08:24:31 +01:00
adam closed this issue 2025-12-29 08:24:31 +01:00
Author
Owner

@StefH commented on GitHub (Dec 18, 2019):

It's only possible to enable proxing for all requests via ProxyAndRecordSettings when starting.

Or via a single mapping:

{
    "Request": {
      "Path": {
        "Matchers": [
          {
            "Name": "WildcardMatcher",
            "Pattern": "/google"
          }
        ]
      },
      "Methods": [
        "get"
      ]
    },
    "Response": {
      "UseTransformer": false,
      "ProxyUrl": "http://www.google.com"
    }
}

It's not possible to enable/configure the global proxy - mode via the admin interface.

@StefH commented on GitHub (Dec 18, 2019): It's only possible to enable proxing for all requests via ProxyAndRecordSettings when starting. Or via a single mapping: ``` js { "Request": { "Path": { "Matchers": [ { "Name": "WildcardMatcher", "Pattern": "/google" } ] }, "Methods": [ "get" ] }, "Response": { "UseTransformer": false, "ProxyUrl": "http://www.google.com" } } ``` It's not possible to enable/configure the global proxy - mode via the admin interface.
Author
Owner

@RajnishChhn commented on GitHub (Dec 18, 2019):

I have been trying the mapping approach, but somehow it's not recording anything, neither is it creating a mapping file. The first approach however works fine for me.
I am trying to create a webpage where the user can give the url he/she needs to proxy and record. Any suggestion would help.

@RajnishChhn commented on GitHub (Dec 18, 2019): I have been trying the mapping approach, but somehow it's not recording anything, neither is it creating a mapping file. The first approach however works fine for me. I am trying to create a webpage where the user can give the url he/she needs to proxy and record. Any suggestion would help.
Author
Owner

@LevYas commented on GitHub (Apr 22, 2020):

I am trying to create a webpage where the user can give the url he/she needs to proxy and record. Any suggestion would help.

I would try to make a very simple asp net core API, which receives the URL and dynamically forms proxy settings and starts the WireMock instance.

@LevYas commented on GitHub (Apr 22, 2020): > I am trying to create a webpage where the user can give the url he/she needs to proxy and record. Any suggestion would help. I would try to make a very simple asp net core API, which receives the URL and dynamically forms proxy settings and starts the WireMock instance.
Author
Owner

@StefH commented on GitHub (Apr 22, 2020):

@LevYas
Solution would be like :

@StefH commented on GitHub (Apr 22, 2020): @LevYas Solution would be like : - make sure wiremock is running somewhere - create a simple web-api - this simple api takes a url and uses the WireMock.Net.RestClient (https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference) to change some mappings on the running wiremock server
Author
Owner

@StefH commented on GitHub (Apr 4, 2022):

@RajnishChhn
did you try latest versions?

@StefH commented on GitHub (Apr 4, 2022): @RajnishChhn did you try latest versions?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#236