Open NghiaTranUIT opened 8 months ago
Will add more details requirement for the External Proxy, Bypass Proxy, Include List and the Unit Test soon 👍
ExternalProxyService
, ExternalProxySetting
EncryptionService.swift
host
and port
from the ProxyServer, we should call proxySetting(isHTTPS: Bool, host: String, port: Int) -> ExternalProxySetting
to return to the correct Proxy for this Host/Port => Verify we carefully port it to TypeScriptcurl 'https://httpbin.proxyman.app/get?id=123' --proxy http://localhost:9090
-> Verify: httpbin.proxyman.app
shows in both Proxyman + Charles Proxycurl 'https://www.google.com/' --proxy http://localhost:9090
-> Verify: www.google.com
shows in both Proxyman + Charles Proxycurl "http://httpbin.org/get?id=123" --proxy localhost:9090
-> Verify: httpbin.org
shows in both Proxyman + Charles Proxycurl "http://www.producthunt.com" --proxy localhost:9090
-> Verify: www.producthunt.com
shows in both Proxyman + Charles ProxyExternalProxySettingService.swift
paresHostList(hostList:)
works correctly to parse the Host from a given List.*.api.com
For example:
127.0.0.1, localhost,data.com,proxyman,io, api.proxyman.com
will parse to
127.0.0.1
localhost
data.com
proxyman.io
api.proxyman.io
-> Seperated by the ,
and trim the whitespace + newline of each entry (Leading & Trailing position)
httpbin.proxyman.app:443, www.google.com
curl "https://httpbin.proxyman.app/get?id=123" --proxy localhost:9090
-> Verify: httpbin.proxyman.app
only shows in Proxyman, not Charles Proxy (because it matched the Bypass Proxy)curl "https://www.google.com" --proxy localhost:9090
-> Verify: www.google.com
only shows in Proxyman, not Charles Proxy (because it matched the Bypass Proxy)curl "http://httpbin.org/get?id=123" --proxy localhost:9090
-> Verify: httpbin.org
only shows in Proxyman + Charles Proxy -> It matches the external Proxy, but doesn't match the bypass proxycurl "http://www.producthunt.com" --proxy localhost:9090
-> Verify: www.producthunt.com
only shows in Proxyman + Charles Proxy -> It matches the external Proxy, but doesn't match the bypass proxycurl "http://localhost:3000" --proxy localhost:9090
-> Verify: localhost:3000
only shows in Proxyman + Charles Proxy -> It matches the external Proxy, but doesn't match the bypass proxyhttpbin.proxyman.app:443, www.google.com
curl "http://www.producthunt.com" --proxy localhost:9090
-> Verify: www.producthunt.com
only shows in Proxyman + Charles Proxy -> It matches the external Proxy, but doesn't match the bypass proxycurl "http://localhost:3000" --proxy localhost:9090
-> Verify: localhost:3000
only shows in Proxyman, not Charles Proxy -> It matches the external Proxy, and matched the Always bypass localhost
.ExternalProxySettingService
, so it should inherit all logic from the Bypass Proxy*.app
curl "https://httpbin.proxyman.app/get?id=123" --proxy localhost:9090
-> Verify: httpbin.proxyman.app
shows in Proxyman and Charles Proxy (because it matched the Include List)curl "https://www.google.com" --proxy localhost:9090
-> Verify: www.google.com
only shows in Proxyman, not Charles Proxy (because it doesn't match the Include List)curl "http://httpbin.org/get?id=123" --proxy localhost:9090
-> Verify: httpbin.org
only shows in Proxyman, not Charles Proxy (because it doesn't match the Include List)curl "http://www.producthunt.com" --proxy localhost:9090
-> Verify: www.producthunt.com
only shows in Proxyman, not Charles Proxy (because it doesn't match the Include List)curl "http://localhost:3000" --proxy localhost:9090
-> Verify: localhost:3000
only shows in Proxyman, not Charles Proxy -> It matches the external Proxy, but doesn't match the Include ListExternalProxyServiceTests.swift
, ByPassProxyServiceTests.swift
, and IncludeListProxyServiceTests.swift
. Ping @NghiaTranUIT to get these files.Example:
1. Start Proxyman Server by code
2. Start a local proxy server (can be found on NPM)
3. Set External Proxy to this local proxy server
4. Send a Request by code
5. Verify the `flowPool` of the ProxyCore and the List of passed requests on the Local Server -> Confirm it's passed or not.
6. Repeat with all `cURL`
Description
Some users report that they are using their corporated Proxy Server to access the Internet. They need the External Proxy Tools from macOS to work on Windows.
See how it works on macOS:
Requirement for the External Proxy
UI
How External Proxy Works
On Proxyman -> Tools -> Proxy Setting -> External Proxy Settings
Make a cURL to port 9090 (Proxyman). Here is how it works:
5.1. cURL sent a HTTP Request to Proxyman 5.2. Proxyman detects that External Proxy Service is ON 5.3. Proxyman sent CONNECT Request
5.4. Charles receives a new CONNECT and then response:
5.5 Proxyman reads this Response from Charles Proxy and starts a tunnel to Charles Proxy 5.6 When the Tunnel is ready, here is how it looks
cURL -> Proxyman ---(External Proxy)---> Charles PRoxy -> The Internet
⚠️ it should work with HTTP, HTTPS (intercept), and proxy HTTPS Mode.
Logic: External Proxy Setting
ExternalProxyService
,ExternalProxySetting
,BypassProxyEntry
andExternalProxySettingService
and try to port to Windows/Linux