By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,619 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

Script to help stop people using bandwidth

P: n/a
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?
Any help would be appreciated..
Jul 23 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Hoops wrote:
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?


And if the user has javascript disabled?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

P: n/a
Hoops hu kiteb:
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?


Javascript cant do that.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 23 '05 #3

P: n/a
In article <4k********************************@4ax.com>,
Hoops <ho*********@yahoo.com> wrote:
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?
Any help would be appreciated..


Do you have an URL?

Why don't you want people using your site? Perhaps you can sell some
advertisement.

What do you wish to prevent?

Perhaps you can put up an intro page that is text only with link to your
'real' home page. Remove as many images as you can from your home page.

Put a password on your site.

Robert
Jul 23 '05 #4

P: n/a
JRS: In article <4k********************************@4ax.com>, dated
Sat, 18 Sep 2004 20:20:17, seen in news:comp.lang.javascript, Hoops
<ho*********@yahoo.com> posted :
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?


If the user is not both malicious and intelligent, it is likely that he
will have javascript and cookies enabled.

If so, maybe get each page to set a cookie early on, with usage count
and short expiry. If the count is too high, redirect with script
location.href=<elsewhere>

If the user may be trying to defeat caching, check to see if there is a
? in the URL, and if so redirect.

Redirect to a page of minuscule bandwidth; I use an empty file.
If, however, you wish to protect against one who knows as much as Jim &
others, your only hope is to delete all your files from the server.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
Jul 23 '05 #5

P: n/a
On Sun, 19 Sep 2004 17:50:56 +0100, Dr John Stockton wrote:
If, however, you wish to protect against one who knows as much as Jim &
others, your only hope is to delete all your files from the server.


I was waiting for somebody to say that.. ;-)
Jul 23 '05 #6

P: n/a
In article <4k********************************@4ax.com>,
ho*********@yahoo.com enlightened us with...
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?
Any help would be appreciated..


You can't use javascript for this.

Get a good server, either Apache or IIS (if you're stuck and can't get Apache
*g*).
Assuming Apache, learn how to look at your log files. Get the IP address of
the person(s) doing this. Put that in a .htaccess file to deny them access at
all.
Learn a decent server-side scripting language, such as Perl, that can parse
your log file. Set that up to look daily at your log files, get the IP
address(es) of anyone using too much bandwidth (you'd have to decide how much
is too much), and have it edit the htaccess file accordingly.

Anyway, that's what I'd do. :)

This assumes you have the ability to set cron jobs and look at log files,
which my host does allow. If yours doesn't, move hosts if you can. My host
isn't pricey or anything.

--
--
~kaeli~
Acupuncture is a jab well done.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7

P: n/a
In article <4k********************************@4ax.com>,
ho*********@yahoo.com enlightened us with...
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?
Any help would be appreciated..


I forgot to add that I think that search spiders do use your bandwidth, so if
you have heavy pages, you may want to add code in there to stop the nicer
ones from indexing the heavy pages. Note that this will decrease your ratings
in some engines, though.

--
--
~kaeli~
Acupuncture is a jab well done.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #8

P: n/a
kaeli wrote:
In article <4k********************************@4ax.com>,
ho*********@yahoo.com enlightened us with...
Does anyone have a good java script that I can add to my page so that
the same user doesn't pound my site and use all of my bandwidth?
Any help would be appreciated..

You can't use javascript for this.

Get a good server, either Apache or IIS (if you're stuck and can't get Apache
*g*).
Assuming Apache, learn how to look at your log files. Get the IP address of
the person(s) doing this. Put that in a .htaccess file to deny them access at
all.
Learn a decent server-side scripting language, such as Perl, that can parse
your log file. Set that up to look daily at your log files, get the IP
address(es) of anyone using too much bandwidth (you'd have to decide how much
is too much), and have it edit the htaccess file accordingly.


That works good and predictably with static IP addresses. What about
Dynamic IP Addresses? I can connect to a site with AOL, reboot, go back
to the same site and have a different IP Address.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9

P: n/a
Randy Webb wrote:
Assuming Apache, learn how to look at your log files. Get the IP address of
the person(s) doing this. Put that in a .htaccess file to deny them access at
all.
Learn a decent server-side scripting language, such as Perl, that can parse
your log file. Set that up to look daily at your log files, get the IP
address(es) of anyone using too much bandwidth (you'd have to decide how much
is too much), and have it edit the htaccess file accordingly.


That works good and predictably with static IP addresses. What about
Dynamic IP Addresses? I can connect to a site with AOL, reboot, go back
to the same site and have a different IP Address.


Another problem with the technique of simply denying access to the IP Address of a
host that is making an excessive number of requests is that a lot of ISPs offer
proxy servers to their customers. As a result, a Web site may see a lot of traffic
from a specific IP address (the proxy server). Denying access to your site from
that proxy's IP Address could potentially reduce your audience by several thousand
people.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #10

P: n/a
In article <Ke********************@comcast.com>, Hi************@aol.com
enlightened us with...
That works good and predictably with static IP addresses. What about
Dynamic IP Addresses? I can connect to a site with AOL, reboot, go back
to the same site and have a different IP Address.


That's why the cron runs and changes the htaccess file daily.
Access is only blocked for a day. If they stop it, they get access again
tomorrow. If they keep pushing it, well, they're banned again.

--
--
~kaeli~
Profanity: the single language in which all programmers are
expert.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #11

P: n/a
In article <41***************@agricoreunited.com>, gw*****@agricoreunited.com
enlightened us with...

Another problem with the technique of simply denying access to the IP Address of a
host that is making an excessive number of requests is that a lot of ISPs offer
proxy servers to their customers. As a result, a Web site may see a lot of traffic
from a specific IP address (the proxy server). Denying access to your site from
that proxy's IP Address could potentially reduce your audience by several thousand
people.


That's one I didn't think of, and it would be a concern if my site were a
commercial one.

Since it isn't, it's not. :)

But, great point.

Of course, if you knew, or suspected, such a thing, you could alway allow
traffic from the proxies, but then you leave yourself open to the abusers
using those proxies.

I was kind of under the impression that the OP's site was not a commercial
one and he rather knew, or had a good idea, of who the abuser was, if not
personally, then by the IP addy.

I do wonder, though, b/c I use a proxy here at work, but when sites get my
IP, it's really my IP, not my proxy server. I've checked. Is this a setting
on the proxy?

--
--
~kaeli~
Profanity: the single language in which all programmers are
expert.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #12

P: n/a
kaeli wrote:
In article <41***************@agricoreunited.com>, gw*****@agricoreunited.com
enlightened us with...
Another problem with the technique of simply denying access to the IP Address of a
host that is making an excessive number of requests is that a lot of ISPs offer
proxy servers to their customers. As a result, a Web site may see a lot of traffic
from a specific IP address (the proxy server). Denying access to your site from
that proxy's IP Address could potentially reduce your audience by several thousand
people.
That's one I didn't think of, and it would be a concern if my site were a
commercial one.

Since it isn't, it's not. :)

But, great point.

Of course, if you knew, or suspected, such a thing, you could alway allow
traffic from the proxies, but then you leave yourself open to the abusers
using those proxies.

I was kind of under the impression that the OP's site was not a commercial
one and he rather knew, or had a good idea, of who the abuser was, if not
personally, then by the IP addy.


I guess I am in a small group, as I have both a dynamic and static IP
address available to me at any given time (AOL and my Cable).
I do wonder, though, b/c I use a proxy here at work, but when sites get my
IP, it's really my IP, not my proxy server. I've checked. Is this a setting
on the proxy?


Yes.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.