mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-25 16:15:55 +03:00
[GH-ISSUE #1839] Can Proxyman support dynamic environment variables? #1832
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1832
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @Seayon on GitHub (Nov 5, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1839
Originally assigned to: @NghiaTranUIT on GitHub.
Description
In my case, I have some variables with fixed keys, but their values change frequently. Previously, I manually opened the script and wrote the new values, but it became tedious. So, I tried writing the variables to the ~/.zshrc file and changed the ENV in ~/.zshrc quickly. However, I found that Proxyman couldn't read the latest variables.
Is it possible to provide a hook for Proxyman to get the latest environment variables? Or, can Proxyman support a feature to save simple variables and let me choose one from the menu bar quickly?
Thank you!
Why this feature/change is important?
Proxyman is a very professional and easy-to-use tool. Adding such a feature doesn't feel very complicated, but it would provide higher customization options for professional users.
@NghiaTranUIT commented on GitHub (Nov 5, 2023):
Proxyman Scripting can read your ENV from
~/.zshrc(docs).Here is the example:
@Seayon commented on GitHub (Nov 5, 2023):
Thank you for your reply!
I am able to use the ENV from ~/.zshrc, and I find that the Proxyman documentation is very comprehensive. However, my problem is whether Proxyman can automatically read the updated from ~/.zshrc ?
@NghiaTranUIT commented on GitHub (Nov 5, 2023):
It's not automatically load the env yet because it's an expensive operation. That's the reason why I introduced the "Reload env" button.
How often your ENV is changed that you need to reload the ENV automatically?
@Seayon commented on GitHub (Nov 5, 2023):
Actually, The frequency of changes actually depends on how busy I am at the moment. I am working on multiple projects simultaneously, and each project has a fixed key. However, the value that determines the flow direction for each project is different. That's why I want to have a 'Quick Switch and Reload' feature. I usually do it manually,which is why I would like to have a hook to inform Proxyman to reload the ENV ?
@Seayon commented on GitHub (Nov 5, 2023):
By the way, I fully understand that automatically loading environment variables is also an expensive operation. Therefore, I'm wondering if it's possible to provide a hook or API for me to call?
@NghiaTranUIT commented on GitHub (Nov 6, 2023):
I guess I can introduce a helper func, like:
It runs synchronously and you can run it directly in your Scripts. How do you feel?
@Seayon commented on GitHub (Nov 6, 2023):
Does this mean I have to call it within a script in Proxyman? Can I have my own program call it instead? Some external applications or shell scripts that I developed myself. If this is very difficult, then calling it within a Proxyman script is also good, at least I can use it.
@NghiaTranUIT commented on GitHub (Nov 8, 2023):
@Seayon you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.14.0_Scripting:_Reload_Env_by_scripts.dmg
@Seayon commented on GitHub (Nov 9, 2023):
Thanks ! That's definely helpful !