Remove ping responses

This commit is contained in:
Shreerang Kale 2025-07-28 19:55:43 +05:30
parent 3d91cca7c6
commit 4a6331c71f
2 changed files with 1 additions and 20 deletions

View File

@ -20,4 +20,4 @@
- This will start the proxy with,
- RPC endpoint at: <http://0.0.0.0:8545>
- WS endpoint at: <http://0.0.0.0:8545/ws>
- WS endpoint at: <ws://0.0.0.0:8545/ws>

View File

@ -74,17 +74,6 @@ class WebSocketProxy:
self.logger.debug(f"Received from client: {data}")
# Handle ping messages locally
if method == "ping":
pong_response = {
"jsonrpc": "2.0",
"result": "pong",
"id": data.get("id")
}
await client_ws.send_str(json.dumps(pong_response))
self.logger.debug("Responded to ping with pong")
continue
transformed_request = provider.transform_request(data)
await provider_ws.send_str(json.dumps(transformed_request))
@ -96,10 +85,6 @@ class WebSocketProxy:
self.logger.error(f"Error forwarding to provider: {e}")
break
elif msg.type == WSMsgType.PING:
await client_ws.pong(msg.data)
self.logger.debug("Responded to WebSocket ping with pong")
elif msg.type == WSMsgType.ERROR:
self.logger.error(f'WebSocket error: {client_ws.exception()}')
break
@ -140,10 +125,6 @@ class WebSocketProxy:
# Don't break here - continue processing other messages
continue
elif msg.type == WSMsgType.PING:
await provider_ws.pong(msg.data)
self.logger.debug(f"Responded to provider WebSocket ping from {provider.name}")
elif msg.type == WSMsgType.ERROR:
self.logger.error(f'Provider WebSocket error: {provider_ws.exception()}')
break