This repository was archived by the owner on Oct 23, 2024. It is now read-only.
Enhance listening host configuration in cmd/sql-proxy-client via PLANETSCALE_LISTENING_HOST environment variable #183
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.
Summary
This PR enhances the flexibility of setting the listening host in cmd/sql-proxy-client/main.go. It allows the host to be configured via an environment variable,
PLANETSCALE_LISTENING_HOST, while maintaining "127.0.0.1" as the default value if the variable is not set.Changes
Modified the host flag to dynamically fetch its value from the
PLANETSCALE_LISTENING_HOSTenvironment variable, defaulting to "127.0.0.1" if the variable is not set.Why
This change provides users with the ability to easily configure the listening host via an environment variable without losing the convenience of a default value.
How to Test
PLANETSCALE_LISTENING_HOSTand run the SQL proxy client. Verify that it listens on the default "127.0.0.1" host.PLANETSCALE_LISTENING_HOSTto a desired host.PLANETSCALE_LISTENING_HOSTenvironment variable.Maintainer:
@skottler, please have a look when you can.