TCP connections Rate Limiting using HAProxy

We are planning to use haproxy to rate limiting all the TCP traffic based on the data size. if the data size is more than the configured value then it should be rejected.

Please advise any one have done this kind of setup ?