update to handle new structure from spectra, no more gobs (#1266)
This commit is contained in:
+1
-16
@@ -10,7 +10,6 @@ load_dotenv()
|
||||
API_KEY = os.getenv("SPECTRA_API_KEY", "")
|
||||
BASE_URL = os.getenv("SPECTRA_API_URL", "")
|
||||
WS_URL = os.getenv("SPECTRA_WS_SQB_URL", "")
|
||||
WS_GOB_URL = os.getenv("SPECTRA_WS_GOB_URL", "")
|
||||
|
||||
|
||||
async def test_http():
|
||||
@@ -42,27 +41,13 @@ async def test_ws_sqb():
|
||||
print(f"[WS-SQB] Failed: {type(e).__name__}: {e}")
|
||||
|
||||
|
||||
async def test_ws_gob():
|
||||
"""Test GOB WebSocket connection."""
|
||||
url = WS_GOB_URL
|
||||
print(f"\n[WS-GOB] Connecting to {url}")
|
||||
try:
|
||||
async with connect(url, additional_headers={"Authorization": API_KEY}, open_timeout=15) as ws:
|
||||
print("[WS-GOB] Connected! Waiting for message (10s)...")
|
||||
msg = await asyncio.wait_for(ws.recv(), timeout=10)
|
||||
print(f"[WS-GOB] Got message ({len(msg)} bytes)")
|
||||
except Exception as e:
|
||||
print(f"[WS-GOB] Failed: {type(e).__name__}: {e}")
|
||||
|
||||
|
||||
async def main():
|
||||
print(f"API Key configured: {'Yes' if API_KEY else 'No'}")
|
||||
print(f"Base URL: {BASE_URL}")
|
||||
print(f"WS URL: {WS_URL}")
|
||||
print(f"WS GOB URL: {WS_GOB_URL}\n")
|
||||
print()
|
||||
await test_http()
|
||||
await test_ws_sqb()
|
||||
await test_ws_gob()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user