-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_proxy.py
More file actions
24 lines (20 loc) · 877 Bytes
/
debug_proxy.py
File metadata and controls
24 lines (20 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
import sys
try:
# Test direct connection to httpbin first
print("Testing direct connection to httpbin.org...")
direct_resp = requests.get("https://httpbin.org/get")
print(f"Direct response status: {direct_resp.status_code}")
print(f"Direct response length: {len(direct_resp.text)}")
print(f"Direct response preview: {direct_resp.text[:100]}...")
# Test through our proxy
print("\nTesting through proxy...")
proxy_resp = requests.get("http://localhost:3000/https://httpbin.org/get")
print(f"Proxy response status: {proxy_resp.status_code}")
print(f"Proxy response length: {len(proxy_resp.text)}")
print(f"Proxy response: {repr(proxy_resp.text)}")
# Print headers
print(f"\nProxy response headers: {dict(proxy_resp.headers)}")
except Exception as e:
print(f"Error: {e}")
sys.exit(1)