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

Change TARPIT_HOST to detect isolated network #1862

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
from urllib3.util import ssl_

# We need a host that will not immediately close the connection with a TCP
# Reset. SO suggests this hostname
TARPIT_HOST = "10.255.255.1"
# Reset.
if platform.system() == "Windows":
# Reserved loopback subnet address
TARPIT_HOST = "127.0.0.0"
else:
# Reserved internet scoped address. See https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
pquentin marked this conversation as resolved.
Show resolved Hide resolved
TARPIT_HOST = "240.0.0.0"

# (Arguments for socket, is it IPv6 address?)
VALID_SOURCE_ADDRESSES = [(("::1", 0), True), (("127.0.0.1", 0), False)]
Expand Down