-
Notifications
You must be signed in to change notification settings - Fork 7
Create DevMode proxy through Gravity #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -126,24 +126,32 @@ Examples: | |||||
| log.Fatal("failed to find available port: %s", err) | ||||||
| } | ||||||
|
|
||||||
| connectProxyPort, _ := cmd.Flags().GetInt("proxy-port") | ||||||
| var connectProxyPortPtr *uint | ||||||
| if connectProxyPort > 0 { | ||||||
| port := uint(connectProxyPort) | ||||||
| connectProxyPortPtr = &port | ||||||
| } | ||||||
|
|
||||||
| server, err := dev.New(dev.ServerArgs{ | ||||||
| APIURL: apiUrl, | ||||||
| APIKey: apiKey, | ||||||
| Hostname: endpoint.Hostname, | ||||||
| Config: &gravity.Config{ | ||||||
| Context: ctx, | ||||||
| Logger: log, | ||||||
| Version: Version, | ||||||
| OrgID: orgId, | ||||||
| Project: theproject, | ||||||
| EndpointID: endpoint.ID, | ||||||
| URL: gravityUrl, | ||||||
| SDKKey: project.Secrets["AGENTUITY_SDK_KEY"], | ||||||
| ProxyPort: uint(proxyPort), | ||||||
| AgentPort: uint(agentPort), | ||||||
| Ephemeral: true, | ||||||
| ClientName: "cli/devmode", | ||||||
| DynamicHostname: true, | ||||||
| Context: ctx, | ||||||
| Logger: log, | ||||||
| Version: Version, | ||||||
| OrgID: orgId, | ||||||
| Project: theproject, | ||||||
| EndpointID: endpoint.ID, | ||||||
| URL: gravityUrl, | ||||||
| SDKKey: project.Secrets["AGENTUITY_SDK_KEY"], | ||||||
| ProxyPort: uint(proxyPort), | ||||||
| AgentPort: uint(agentPort), | ||||||
| ConnectProxyPort: connectProxyPortPtr, | ||||||
| Ephemeral: true, | ||||||
| ClientName: "cli/devmode", | ||||||
| DynamicHostname: true, | ||||||
| }, | ||||||
| }) | ||||||
| if err != nil { | ||||||
|
|
@@ -308,6 +316,7 @@ func init() { | |||||
| rootCmd.AddCommand(devCmd) | ||||||
| devCmd.Flags().StringP("dir", "d", ".", "The directory to run the development server in") | ||||||
| devCmd.Flags().Int("port", 0, "The port to run the development server on (uses project default if not provided)") | ||||||
| devCmd.Flags().Int("proxy-port", 19081, "The port to run the HTTP CONNECT proxy server on (disabled if zero)") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default should be disabled to match PR description and avoid unexpected proxy start The flag help says “disabled if zero,” but default 19081 enables it by default. Consider defaulting to 0. Apply this diff: - devCmd.Flags().Int("proxy-port", 19081, "The port to run the HTTP CONNECT proxy server on (disabled if zero)")
+ devCmd.Flags().Int("proxy-port", 0, "The port to run the HTTP CONNECT proxy server on (disabled if zero)")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| devCmd.Flags().Bool("no-build", false, "Do not build the project before running it (useful for debugging)") | ||||||
| devCmd.Flags().MarkHidden("no-build") | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default enables proxy despite “disabled if zero” description (and PR states default disabled)
Current default 19081 enables the CONNECT proxy by default. Either set default to 0 (and keep description), or update description/PR to reflect enabled-by-default. Also validate port range.
Apply this diff to make it disabled by default and validate:
Also applies to: 319-319