开发者

Limiting bandwidth in htmlunit

开发者 https://www.devze.com 2023-02-28 05:51 出处:网络
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'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.

0

精彩评论

暂无评论...
验证码 换一张
取 消