Print proxy URL when starting Dev Proxy in detach mode#1591
Open
Print proxy URL when starting Dev Proxy in detach mode#1591
Conversation
…mode Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Print assigned port number when starting Dev Proxy in detach mode
Print proxy URL when starting Dev Proxy in detach mode
Mar 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Improves detached-mode startup output so callers can discover the actual proxy address when using OS-assigned ports (--port 0), by persisting the resolved proxy port and printing a Proxy URL in the parent process.
Changes:
- Update
ProxyEngineto set the runtime port after the proxy endpoint is started, and (when running as the internal daemon) re-save the detached state file with the resolved port. - Update detached-mode startup polling to wait for
state.Port > 0and print a newProxy URL:line in the console output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| DevProxy/Proxy/ProxyEngine.cs | After starting the proxy endpoint, updates the effective port and re-saves detached state with the resolved port for --port 0. |
| DevProxy/Program.cs | In detached startup output, waits for a non-zero port and prints the resolved Proxy URL alongside PID/API URL/log file. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
devproxy --port 0 --detachdidn't show the assigned proxy port, making the proxy unusable since the caller can't know where to connect.StartAsync(), update_config.Portfrom the actual endpoint port (resolves OS-assigned port for--port 0). Re-save state file when running as daemon so the parent process picks up the resolved value.Proxy URLline between PID and API URL in detach output. Wait forstate.Port > 0instead of just state existence to avoid reading stale port 0 before the engine updates it.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy /home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy --as-system-proxy false --port 0 --api-port 0 --_internal-daemon(dns block)/home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy /home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy stop(dns block)/home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy /home/REDACTED/work/dev-proxy/dev-proxy/DevProxy/bin/Debug/net10.0/devproxy --as-system-proxy false --port 8000 --api-port 0 --_internal-daemon(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.