I'm using htmlunit to make some tests but I don't want them to use all my available bandwidth. How can I set a limit on upload/download speed?
I have found I can ge开发者_JAVA百科t an InputStream
from a WebResponse
. I think this could be used to limit download speed, if I wait some time between reads. But what about upload? I have found no equivalent OutputStream
in the API. Thanks.
I'm not sure if this fits your needs but to control network traffic I setup a local proxy server and you can have htmlunit use the proxy. Within that proxy you can control bandwidth and many other options.
Hope that help.
精彩评论