Just replace 192.168.1.2 with your server address (mine is just a computer on the LAN). One odd side-effect is that under the Status -> LAN tab, the server IP shows up as having "xvids-db.com" for the host name (xvids-db.com is the last entry in the hosts file), whereas before, it was the computer's name. Any ideas why it does that? I'm sure it has something to do with the hosts redirecting to 192.168.1.2.
Anyway, here's a small server I made which listens on port 80. It's for Windows only and you will need to allow it thru the firewall (LAN traffic only is recommended). The main intent is to return a blank response so that the webpage won't show an error for the blocked ads. I didn't bother returning a 1x1 pixel or anything for images, because it doesn't seem to be needed. A nice bonus to using this little server is that it will log all the ad hosts that have been encountered. I wish DD-WRT had some kind of built-in server like this, but this works for me since I almost always leave the "server" computer on.
v1.03: Now serves a transparent 1x1 gif/png whenever possible. Removed some debugging code.
v1.02: Fixed "unknown host" issue. Improved speed.
v1.01: The AdServer_Hosts.txt file has been renamed to AdServer.dat. Improved column sorting behavior.
TIP: right-click on the textbox or listview for additional options.
I booted my router this morning and the ad block script stopped working. Since I am a noobie at this router script stuff I was wondering if I could get some suggestions on what to check for to trouble-shoot this.
There's no reason to make this script "sticky".
It bluntly and selfishly overwrites the original /tmp/hosts
All my local hosts were in there.... _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Anyway, here's a small server I made which listens on port 80. It's for Windows only and you will need to allow it thru the firewall (LAN traffic only is recommended). The main intent is to return a blank response so that the webpage won't show an error for the blocked ads. I didn't bother returning a 1x1 pixel or anything for images, because it doesn't seem to be needed. A nice bonus to using this little server is that it will log all the ad hosts that have been encountered. I wish DD-WRT had some kind of built-in server like this, but this works for me since I almost always leave the "server" computer on.
Cool. Thanks. I'd been using pixelserv and was thinking about posting about that. Pixelserv (I used v1.0) is perl so you can run it either with free version of ActivePerl or compile it with perl2exe. But your program is an intriguiing alternative that I'm going to try for a bit.
As I said before, pretty cool. One minor comment, do you think it would be possible to list the IP address for sites that don't resolve? I have some "{unknown}" entries that really don't tell me anything. Or maybe still say "(unknown)" if it doesn't resolve but just add a column and include IP address so that info is availble as well? Thanks again, not meant as criticism, just hopefully constructive feedback.
do you think it would be possible to list the IP address for sites that don't resolve? I have some "{unknown}" entries that really don't tell me anything.
AdServer simply extracts the host field from the http headers. But sometimes there isn't a host and the headers look like a bunch of gibberish. I call those cases "unknown".
For example, here's the headers that AdServer sees when you load digg.com:
I appreciate what you have done with your program. However, it really makes things slow. That may be the 1.6gHz server I am using for it but is there any way to just send a blank page without the graphics or maybe some info like IP address where the ad would go?
I appreciate what you have done with your program. However, it really makes things slow. That may be the 1.6gHz server I am using for it but is there any way to just send a blank page without the graphics or maybe some info like IP address where the ad would go?
It sends a blank character, and as of v1.02 it also responds with these headers...
Quote:
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1
Connection: close
I still haven't seen the need to send blank images yet, so for now I'll just stick with the blank character.
It also runs quicker. Let me know if you have any more problems with it.
Posted: Sat Aug 30, 2008 4:02 Post subject: **** UPDATE ****
I am part of the MS Beta for Internet Explorer 8. The pages blocked by this fine code are now displayed a little nicer by default. It still says "Internet Explorer couldn't...." but it looks nicer and is acceptabile for me on my home network.
Thanks to all of those that came up with this....kudos! It works great!
Joined: 07 Jun 2006 Posts: 1488 Location: the Netherlands
Posted: Sat Aug 30, 2008 8:58 Post subject:
Why not use the mini_httpd for dd-wrt, the one bwlog uses? That way you'll be able to run the adserver on your router _________________ Firmware: DD-WRT v24-sp2 (latest available) mega
WRT320N