mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #1844] How to "programmatically" set external proxy per request? #1837
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#1837
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 @seidnerj on GitHub (Nov 9, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1844
In my scenario - I have a process that has multiple sessions, each using a different (but fixed per session) proxy server. This is fine in general, I simply set the code to use a specific proxy server per session.
I need to see what's happening during the requests done by any given session, for this I use Proxyman. However, now begs the question how do I replicate this same behavior while maintaining the above logic. If I want to use Proxyman, I need to set the proxy server to Proxyman's address, I can also set a specific external proxy, but this isn't enough.
I guess I could use multiple processes of Proxyman, in theory, but I'm not sure if that would work, nor is this a desired experience from a usability standpoint.
Ideally this could provided to Proxyman, per request, by some kind of special header, e.g. "X-Upstream-Proxy" with values such as "http://user:pass@someproxy.com:1312" or "socks5h://user:pass@socksproxy.com:8080".
Is there a way to do something like this currently? if there isn't, is there some kind of workaround that could be implemented to achieve the aforementioned functionality?
Thanks in advance
@NghiaTranUIT commented on GitHub (Nov 10, 2023):
Hey @seidnerj unfortunately, this feature (External Proxy per requests) is not available yet.
Proxyman only supports the External Proxy for all requests that go through Proxyman.
I'm not sure how to workaround since macOS allows 1 Proxyman instance at a time. You can't open multiple Proxyman apps.
@seidnerj commented on GitHub (Nov 10, 2023):
I found a workaround for this. I wrote a small mitmproxy add-on that routes a request to a specific upstream proxy based on a custom header such as I suggested above. I then set Proxyman to use this special proxy as the "External Proxy" so all the traffic first passes through Proxyman then proceeds to be routed to the desired upstream proxy server.
I posted the solution here:
https://stackoverflow.com/questions/77450814/how-to-dynamically-route-and-authenticate-upstream-proxies-in-mitmproxy-based-on