Update server.py

This commit is contained in:
Aryan Singh committed 2026-09-09 00:50:51 -05:00
1 parent cbb1881024
commit eb80290868
1 file changed
+3 -3
+3 -3
View File
@@ -10,14 +10,14 @@ server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind((HOST, PORT))
server_socket.listen()
print(f"Server listening on {HOST}:{PORT}")
# print(f"Server listening on {HOST}:{PORT}")
while True:
conn, addr = server_socket.accept()
print(f"Connected by {addr}")
# print(f"Connected by {addr}")
command = conn.recv(1024)
print("Received Grep Command:", command.decode())
# print("Received Grep Command:", command.decode())
result = subprocess.run(command.decode(), capture_output=True, text=True)
conn.sendall(result.stdout.encode())