mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-03-11 16:35:14 +00:00
Update server.py
This commit is contained in:
parent
62ba25e761
commit
c526bcb6e0
11
server.py
11
server.py
|
@ -231,7 +231,7 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
except:
|
||||
break
|
||||
|
||||
# do response
|
||||
# localhost mode
|
||||
if server_url == "localhost":
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
|
@ -303,7 +303,6 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
|
||||
# stateful mode
|
||||
elif server_connection_type == "stateful":
|
||||
|
||||
proxy_data = {
|
||||
'headers': {
|
||||
"User-Agent": "php-httpproxy/0.1.5 (Client; Python " + python_version() + "; abuse@catswords.net)",
|
||||
|
@ -387,8 +386,8 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
|
||||
print("[*] Received %s chunks. (%s bytes per chunk)" % (str(i), str(buffer_size)))
|
||||
|
||||
else:
|
||||
# stateless mode
|
||||
# stateless mode
|
||||
elif server_connection_type == "stateless":
|
||||
proxy_data = {
|
||||
'headers': {
|
||||
"User-Agent": "php-httpproxy/0.1.5 (Client; Python " + python_version() + "; abuse@catswords.net)",
|
||||
|
@ -425,6 +424,10 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
|||
|
||||
print("[*] Received %s chunks. (%s bytes per chunk)" % (str(i), str(buffer_size)))
|
||||
|
||||
# nothing at all
|
||||
else:
|
||||
raise Exception("Unsupported connection type")
|
||||
|
||||
print("[*] Request and received. Done. %s" % (str(addr[0])))
|
||||
conn.close()
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in New Issue
Block a user