Skip to content

Conversation

@niteshsinghal85
Copy link
Contributor

Fixes #1472

Added support for configuring the Dev Proxy API port via the --api-port command-line option.
This allows users to dynamically set the API port at runtime instead of only through configuration files.

The change makes IProxyConfiguration.ApiPort settable and integrates the new option into the command-line parsing logic with a default value of 8897.

@niteshsinghal85 niteshsinghal85 marked this pull request as ready for review December 26, 2025 12:35
@niteshsinghal85 niteshsinghal85 requested a review from a team as a code owner December 26, 2025 12:35
@waldekmastykarz
Copy link
Collaborator

Cool! We'll review in the next couple of days. Thanks!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for configuring the Dev Proxy API port via the --api-port command-line option, allowing users to dynamically set the API port at runtime instead of only through configuration files.

Key changes:

  • Made IProxyConfiguration.ApiPort settable to support runtime configuration
  • Added --api-port command-line option with a default value of 8897
  • Integrated the new option into command-line parsing and application startup logic

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
DevProxy.Abstractions/Proxy/IProxyConfiguration.cs Changed ApiPort property from read-only to settable to support runtime configuration
DevProxy/Commands/DevProxyCommand.cs Added --api-port option definition with description and help text, and configuration logic to apply the parsed value
DevProxy/Commands/DevProxyConfigOptions.cs Added ApiPort property and option registration for initial parsing
DevProxy/Program.cs Updated Kestrel configuration to use the command-line option with fallback to configuration file

@niteshsinghal85
Copy link
Contributor Author

Hi @waldekmastykarz @garrytrinder

Where and how I do sign this,

Contributor License Agreement is not agreed yet.

@garrytrinder
Copy link
Contributor

@niteshsinghal85 usually a link is provided in the PR for you to follow. Leave it with me, I'll see what I can find.

@garrytrinder garrytrinder self-assigned this Dec 30, 2025
@niteshsinghal85
Copy link
Contributor Author

@dotnet-policy-service agree

@niteshsinghal85
Copy link
Contributor Author

@niteshsinghal85 usually a link is provided in the PR for you to follow. Leave it with me, I'll see what I can find.

thanks for your guidance.

@niteshsinghal85
Copy link
Contributor Author

@waldekmastykarz @garrytrinder can you complete the PR

@garrytrinder
Copy link
Contributor

Yes, now I can, I guess you found the link 😊

@garrytrinder
Copy link
Contributor

@niteshsinghal85 we will merge this PR (and others) in the new year when we will release a new beta version of Dev Proxy. Thanks again for your contribution!

@waldekmastykarz waldekmastykarz enabled auto-merge (squash) January 7, 2026 09:14
@waldekmastykarz waldekmastykarz merged commit 4568cf2 into dotnet:main Jan 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the apiPort setting as a command line option

3 participants