Skip to content
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

make proto configurable #748

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zirain
Copy link
Contributor

@zirain zirain commented Oct 28, 2024

make Proto configurable cause I want to use the combination of reuseport.Listen(“tcp6”, “:8881"), that will listen on [::]:8881 and you can access it with [::]:8881 and 127.0.0.1:8881

IMO, this more like a bug from reuseport package? Because I think reuseport.Listen(“tcp”, “:8881") should be the right way to do this, but it's hard to change a package which isn't updated for three years.

Signed-off-by: zirain <zirain2009@gmail.com>
@@ -11,6 +11,7 @@ import (
)

type Settings struct {
Proto string `envconfig:"PROTO" default:"tcp"`
Copy link
Member

Choose a reason for hiding this comment

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

Nit: how about using Protocol instead of Proto? In our context, Proto could be mistaken with ProtoBuf.

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe a more straighforward DualStack or EnableIPV6 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this align to reuseport.Listen(proto, addr string) (l net.Listener, err error)

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.

2 participants