Script to help stop people using bandwidth

Discussion in 'Javascript' started by Hoops, Sep 19, 2004.

  1. Hoops

    Hoops Guest

    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..
    Hoops, Sep 19, 2004
    #1
    1. Advertising

  2. Hoops

    Fabian Guest

    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
    Fabian, Sep 19, 2004
    #2
    1. Advertising

  3. Hoops

    Randy Webb Guest

    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
    Randy Webb, Sep 19, 2004
    #3
  4. JRS: In article <>, dated
    Sat, 18 Sep 2004 20:20:17, seen in news:comp.lang.javascript, Hoops
    <> 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.
    Dr John Stockton, Sep 19, 2004
    #4
  5. Hoops

    kaeli Guest

    In article <>,
    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
    kaeli, Sep 20, 2004
    #5
  6. Hoops

    kaeli Guest

    In article <>,
    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
    kaeli, Sep 20, 2004
    #6
  7. Hoops

    Randy Webb Guest

    kaeli wrote:
    > In article <>,
    > 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
    Randy Webb, Sep 20, 2004
    #7
  8. Hoops

    Grant Wagner Guest

    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 <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Sep 20, 2004
    #8
  9. Hoops

    kaeli Guest

    In article <>,
    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
    kaeli, Sep 20, 2004
    #9
  10. Hoops

    kaeli Guest

    In article <>,
    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
    kaeli, Sep 20, 2004
    #10
  11. Hoops

    Randy Webb Guest

    kaeli wrote:

    > In article <>,
    > 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
    Randy Webb, Sep 20, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Son KwonNam
    Replies:
    11
    Views:
    2,599
    mr_organic
    Apr 9, 2004
  2. me
    Replies:
    17
    Views:
    728
  3. Replies:
    1
    Views:
    707
    Roger Lindsjö
    Jun 11, 2008
  4. Ryan Davis
    Replies:
    11
    Views:
    175
    Dave Brown
    May 10, 2005
  5. David Mark

    Prototype 1.6--Somebody Stop These People

    David Mark, Dec 24, 2009, in forum: Javascript
    Replies:
    6
    Views:
    452
    David Mark
    Dec 25, 2009
Loading...

Share This Page