-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Issue #1719: resolving hostnames for bind #1723
base: master
Are you sure you want to change the base?
Changes from 1 commit
f3ceae2
b1779b5
61ea13e
f0f2928
06bd5d4
3f633ec
0c45c4a
25935b7
4874c1b
2bdd721
c94048e
d3568c8
7904f3f
0ebf15c
6f91687
51466dc
c597560
4c20ec1
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 |
---|---|---|
|
@@ -538,9 +538,9 @@ class Bind(Setting): | |
validator = validate_list_string | ||
|
||
if 'PORT' in os.environ: | ||
default = ['0.0.0.0:{0}'.format(os.environ.get('PORT'))] | ||
default = ['[::]:{0}'.format(os.environ.get('PORT'))] | ||
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. what about the machine that doesn't support or has not been installed with ipv6 support? 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. The older version dosn't work on IPv6 installations at all. |
||
else: | ||
default = ['127.0.0.1:8000'] | ||
default = ['localhost:8000'] | ||
|
||
desc = """\ | ||
The socket to bind. | ||
|
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.
At least on my machine, this returns only IPv6 addresses from
socket.getaddrinfo()
. Since this is a list, maybe we want to give it two entries so Gunicorn binds to IPv4 and IPv6 by default?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.
If you bind to :: you will listen to any address (IPv4 and IPv6) as long the IPV6_V6ONLY flag is not set.
In fact :: could be written as ::0.0.0.0 which is already the IPv4-compatible address for 0.0.0.0. (Older version of ::FFFF:0.0.0.0)