simulating slow internet connection on localhost
iam using c#,asp.net and iis, i want to simulate slow internet connection on my pc for testing my app.
is it possible i can control bandwidth of iis开发者_开发问答.
please dont suggest
System.Threading.Thread.Sleep(someDuration);
in c# file.
You can run Fiddler and use its connection throttling to simulate a slow connection.
Note that you'll need to browse to your machine name, not localhost
. (localhost.
should also work)
Fiddler will do this for you.
You could find or create a proxy that provides file-configurable or UI-modifyable speed controls. The proxy would get the request from the client, make the request to the server, receive the response, then s-l-o-w-l-y send the response to the client. (It would probaly use some sort of Thread.Sleep(x) in between sending each byte of the response to the client.)
After searching a little on the internet, I found no freeware/FOSS on win32 that does the job for arbitrary ports.
I have a server under tests that listens on port 13000 and a client under test that has a configurable sending port. Many tools, designed for web only, make a throttling tunnel from port 80 to something configurable, but my server will never listen on port 80..
Anyone knows something like unix 'tc' command?
This isn't linked to C#, but I would suggest to slow down the system network (or the vm network ..) instead, it should be much easier to play around. In linux, we can use tc.
sudo tc qdisc add dev wlp3s0 root netem delay 500ms
To turn it off:
sudo tc qdisc del dev wlp3s0 root netem
Source: http://jvns.ca/blog/2017/04/01/slow-down-your-internet-with-tc/
https://linux.die.net/man/8/tc
精彩评论