| import socketio | |
| import time | |
| TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjIsInVzZXJuYW1lIjoia2JqIiwiaWF0IjoxNzgzMjgwMDgwLCJleHAiOjE3ODU4NzIwODB9.MBLOSwph1TCHPB4JB7CXoebkLqGKOgap_SBE9RPWhbI" | |
| BASE_URL = "https://Brighton233j-Messenger-back-database.hf.space" | |
| sio = socketio.Client() | |
| def connect(): | |
| print("Connected as kbj (verified business)! Sending to stranger_test (id 7)...") | |
| sio.emit("send_message", { | |
| "token": TOKEN, | |
| "recipient_id": 7, | |
| "content": "Hi, official message from a verified business — should bypass the request gate" | |
| }) | |
| def on_message(data): | |
| print(f"[msg] is_request={data.get('is_request')} content={data['content']}") | |
| sio.connect(f"{BASE_URL}?token={TOKEN}", socketio_path="/socket.io", transports=["websocket"]) | |
| time.sleep(4) | |
| sio.disconnect() | |