bhcentral

There are certain scrapers and such that like to pillage my pages.

Rather then give them a page not found or something like that which doesn't seem to slow them down much, I would like to make the connection drag on and on and on and then eventually time out.

Anyone have any idea how you would do this programatically in

.net

 ?  Thread.sleep maybe?

perkiset

Very curious why you'd do that, but the simplest way would be to watch the inbound IP ($SERVER['REMOTE_HOST'] I think) and if it matches what you want to delay, simply say "sleep(30)" which will cause <this connection> to go to sleep for 30 seconds. That will put no workload on your server, yet delay things quite a bit. CAVEAT: if you are getting slammed by the spiders and many come all at once, and you have a limit to how many

Apache

  instances can be running, then you just built a framework for a self-induced DDOS attack.

So wrapping up, I s'pose I wanna ask again - WTF do you want to do that?

emonk

I second what perk said, with the added caveat that most unix-likes  (

Linux

 Applause have a maximum open file descriptor limitation, that you can hit surprisingly fast. If they're scraping enough to be a real problem than by holding the port open you might even kill your whole box. It used to happen to me all the time when I hit Digg, or a major news site with my antics.

nutballs

another option is send them slot of irrelevant shit seeded with your links as many ways as you can, trying to get past their cleaner routines. Or to echo the comments, just response.end and move on.

bhcentral

Not using

Apache

 ...Using IIS.  thread.sleep works...but I'm not a big fan of that many threads sleeping.

Side note...once your connection times out a crawler it stops...almost immediately.  VERY effective.

As for the reason  Applause   


Perkiset's Place Home   Politics @ Perkiset's