Websocket - Handshake status 429 Too Many Requests


  • Hi,

    I am getting Handshake status 429 Too Many Requests error when I am trying to run two python scripts in parallel. Both of the script uses the same code to make a websocket connection and subscribes with mode 1. Connections are happening all fine in the beginning but after sometime, connections are being closed automatically with below mentioned error. As per the documentation: Each client code (Angel One trading account id) can have up to three concurrent WebSocket connection

    36f127cc-1feb-452a-9c60-aa30267f095e-image.png

    With my approach, I am only trying to have 2 WebSocket connection.
    Can you please help me with this?

    Error:
    Handshake status 429 Too Many Requests -+-+- {'server': 'nginx', 'date': 'Thu, 29 Aug 2024 04:14:08 GMT', 'content-type': 'text/html;charset=iso-8859-1', 'content-length': '615', 'connection': 'keep-alive', 'x-error-message': 'Invalid Request. Connection Limit Exceeded.', 'cache-control': 'must-revalidate,no-cache,no-store', 'strict-transport-security': 'max-age=31536000; includeSubDomains', 'content-security-policy': "default-src 'self';"} -+-+- b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>\n<title>Error 429 Invalid Request. Connection Limit Exceeded.</title>\n</head>\n<body><h2>HTTP ERROR 429 Invalid Request. Connection Limit Exceeded.</h2>\n<table>\n<tr><th>URI:</th><td>/smart-stream</td></tr>\n<tr><th>STATUS:</th><td>429</td></tr>\n<tr><th>MESSAGE:</th><td>Invalid Request. Connection Limit Exceeded.</td></tr>\n<tr><th>SERVLET:</th><td>org.eclipse.jetty.servlet.ServletHandler$Default404Servlet-5a14e60d</td></tr>\n</table>\n<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.15</a><hr/>\n\n</body>\n</html>\n' - goodbye