[GH-ISSUE #1836] create if not existing option on map local directory #1829

Open
opened 2026-03-03 19:54:46 +03:00 by kerem · 2 comments
Owner

Originally created by @aexvir on GitHub (Nov 1, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1836

Description

when using the map local directory, especially with a wildcard query, I'd like to have an option that would make proxyman create the local json files if they don't exist instead of requesting to the upstream all the time

Why this feature/change is important?

I'm working on a service that on init fetches data from multiple sources, this can sometimes take too much, and I don't want to deal with this stuff when developing, so I'm trying to get proxyman to basically cache those requests on my local filesystem, to always have fast boot when developing, and also so I can edit those payloads every now and then to modify the response

the map local file feature works amazingly for this, but if the url is a bit dynamic the feature is suboptimal, as I either need to manually map every url to its own file, or all of them would reuse the same file

the map local directory feature seems to be the closest to what I want, but there's not an option to create the files if they don't exist, and I can't really create them manually because of the same reason mentioned earlier

I tried to achieve this using scripting but I don't think I can, because the available hooks only allow me to modify the request or the response, but if I modify the response, the request would have already happened, which defeats the purpose of this (please correct me if I'm wrong, I might have not understood this correctly)

Originally created by @aexvir on GitHub (Nov 1, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1836 ## Description when using the map local directory, especially with a wildcard query, I'd like to have an option that would make proxyman create the local json files if they don't exist instead of requesting to the upstream all the time ## Why this feature/change is important? I'm working on a service that on init fetches data from multiple sources, this can sometimes take too much, and I don't want to deal with this stuff when developing, so I'm trying to get proxyman to basically cache those requests on my local filesystem, to always have fast boot when developing, and also so I can edit those payloads every now and then to modify the response the map local file feature works amazingly for this, but if the url is a bit dynamic the feature is suboptimal, as I either need to manually map every url to its own file, or all of them would reuse the same file the map local directory feature seems to be the closest to what I want, but there's not an option to create the files if they don't exist, and I can't really create them manually because of the same reason mentioned earlier I tried to achieve this using scripting but I don't think I can, because the available hooks only allow me to modify the request or the response, but if I modify the response, the request would have already happened, which defeats the purpose of this (please correct me if I'm wrong, I might have not understood this correctly)
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 1, 2023):

You can simply do it by following this steps:

  1. Make a bunch of requests first
  2. Select all -> Right click -> Tool -> Map Local
  3. Proxyman will create all Map Local with all responses.

Screenshot 2023-11-01 at 16 07 31


<!-- gh-comment-id:1788635830 --> @NghiaTranUIT commented on GitHub (Nov 1, 2023): You can simply do it by following this steps: 1. Make a bunch of requests first 2. Select all -> Right click -> Tool -> Map Local 3. Proxyman will create all Map Local with all responses. ![Screenshot 2023-11-01 at 16 07 31](https://github.com/ProxymanApp/Proxyman/assets/5878421/492e6a64-77ed-41ad-b4dc-0d79cd731c20) ---------------------
Author
Owner

@aexvir commented on GitHub (Nov 1, 2023):

yes, I know this, but these requests have dynamic stuff on the url, so I'd need to do this all the time, adding new mappings for every new request url

<!-- gh-comment-id:1788703795 --> @aexvir commented on GitHub (Nov 1, 2023): yes, I know this, but these requests have dynamic stuff on the url, so I'd need to do this all the time, adding new mappings for every new request url
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1829
No description provided.