Fix server-side registration to accept 'client_id' field

- Modified wssshd.py to accept both 'id' and 'client_id' fields for registration
- Added fallback logic: client_id = data.get('client_id') or data.get('id')
- This allows the C client to send 'client_id' while maintaining backward compatibility
- Fixes the KeyError: 'id' issue when C client tries to register
parent ebed579e
......@@ -444,7 +444,7 @@ async def handle_websocket(websocket, path=None):
if debug: print(f"[DEBUG] [WebSocket] Message received: {message[:100]}...")
data = json.loads(message)
if data.get('type') == 'register':
client_id = data['id']
client_id = data.get('client_id') or data.get('id')
client_password = data.get('password', '')
if client_password == server_password:
# Check if client was previously disconnected
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment