Skip to content

Commit

Permalink
Formatted code with black -l 80 slowloris.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gkbrk committed Dec 25, 2020
1 parent 456ad82 commit 9202d3c
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions slowloris.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
type=int,
)
parser.add_argument(
"-v", "--verbose", dest="verbose", action="store_true", help="Increases logging"
"-v",
"--verbose",
dest="verbose",
action="store_true",
help="Increases logging",
)
parser.add_argument(
"-ua",
Expand All @@ -37,10 +41,17 @@
action="store_true",
help="Use a SOCKS5 proxy for connecting",
)
parser.add_argument("--proxy-host", default="127.0.0.1", help="SOCKS5 proxy host")
parser.add_argument("--proxy-port", default="8080", help="SOCKS5 proxy port", type=int)
parser.add_argument(
"--https", dest="https", action="store_true", help="Use HTTPS for the requests"
"--proxy-host", default="127.0.0.1", help="SOCKS5 proxy host"
)
parser.add_argument(
"--proxy-port", default="8080", help="SOCKS5 proxy port", type=int
)
parser.add_argument(
"--https",
dest="https",
action="store_true",
help="Use HTTPS for the requests",
)
parser.add_argument(
"--sleeptime",
Expand Down Expand Up @@ -71,7 +82,9 @@
try:
import socks

socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, args.proxy_host, args.proxy_port)
socks.setdefaultproxy(
socks.PROXY_TYPE_SOCKS5, args.proxy_host, args.proxy_port
)
socket.socket = socks.socksocket
logging.info("Using SOCKS5 proxy for connecting...")
except ImportError:
Expand Down Expand Up @@ -174,7 +187,8 @@ def main():
while True:
try:
logging.info(
"Sending keep-alive headers... Socket count: %s", len(list_of_sockets)
"Sending keep-alive headers... Socket count: %s",
len(list_of_sockets),
)
for s in list(list_of_sockets):
try:
Expand Down

0 comments on commit 9202d3c

Please sign in to comment.