Skip to content

Commit

Permalink
[1.25] Change TARPIT_HOST to detect isolated network (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
hodbn authored and sethmlarson committed Jul 22, 2020
1 parent 80ac9a6 commit 7a4a7a1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
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
# https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
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

0 comments on commit 7a4a7a1

Please sign in to comment.