We’re experiencing an issue in LittleProxy where OutOfMemoryErrors are popping up when reading from a fast server LittleProxy is proxying access to and writing to a slow client configured to use the proxy. The problem is that the data coming in from the server buffers up in memory faster than we can write it to the client. LittleProxy is just a simple HTTP proxy built atop Netty.
Is there any easy way to throttle the read from the remote server to be exactly the same speed as the client is able to read it?
See:
https://github.com/adamfisk/LittleProxy/issues/53
and
You could have a look at source code of : org.jboss.netty.example.proxy.HexDumpProxyInboundHandler
It set the inbound channel readeable flag according to outbound channel’s status. Hope this could help.