开发者

Limiting bandwidth in htmlunit

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜