Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
proxy.py
CHANGED
|
@@ -145,9 +145,8 @@ class ProxyServer:
|
|
| 145 |
while self.running:
|
| 146 |
try:
|
| 147 |
client_socket, client_address = self.server_socket.accept()
|
| 148 |
-
logger.info(f"📥 Connection from {client_address[0]}:{client_address[1]}")
|
| 149 |
|
| 150 |
-
# Handle each client in a separate thread
|
| 151 |
client_thread = threading.Thread(
|
| 152 |
target=self.handle_client,
|
| 153 |
args=(client_socket, client_address)
|
|
@@ -234,10 +233,9 @@ class ProxyServer:
|
|
| 234 |
# Handle health check / direct requests (not proxy requests)
|
| 235 |
# These are requests without http:// prefix - likely HuggingFace health checks
|
| 236 |
if not url.startswith('http://') and not url.startswith('https://'):
|
| 237 |
-
# Return a simple health check response
|
| 238 |
-
health_response = b'HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n{"status": "ok", "service": "HF Proxy"
|
| 239 |
client_socket.send(health_response)
|
| 240 |
-
logger.info(f"💚 Health check from {client_address[0]}")
|
| 241 |
return
|
| 242 |
|
| 243 |
parsed_url = urlparse(url)
|
|
|
|
| 145 |
while self.running:
|
| 146 |
try:
|
| 147 |
client_socket, client_address = self.server_socket.accept()
|
|
|
|
| 148 |
|
| 149 |
+
# Handle each client in a separate thread (no connection log to reduce noise)
|
| 150 |
client_thread = threading.Thread(
|
| 151 |
target=self.handle_client,
|
| 152 |
args=(client_socket, client_address)
|
|
|
|
| 233 |
# Handle health check / direct requests (not proxy requests)
|
| 234 |
# These are requests without http:// prefix - likely HuggingFace health checks
|
| 235 |
if not url.startswith('http://') and not url.startswith('https://'):
|
| 236 |
+
# Return a simple health check response (silent - no logging)
|
| 237 |
+
health_response = b'HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n{"status": "ok", "service": "HF Proxy"}'
|
| 238 |
client_socket.send(health_response)
|
|
|
|
| 239 |
return
|
| 240 |
|
| 241 |
parsed_url = urlparse(url)
|