Should I set up a Dummy HTTP, etc, at "There's no place like home"

(target answers: long time software engineer…Some UDP/TCP, but only browser related When Things Were Rotten back in the CGI days.)

I’m one of those people who likes to have a hosts file populated with to squash attempts to access various ad sites, etc.

Seems intrinsically safer, at least psychosomatically :slight_smile: , but I noticed that while once when it made web pages fill quicker in Firefox (blanked out ads or “complaints” that they could not be connected) I now question whether or not the web pages are waiting for response.

I can write a dummy http server (at 8080/80) to respond immediately with a blank return. Would this be faster than a time-out? Further, in flash or other cases where UDP is attempted, the initial contact would be met quickly with useless info instead of having it wait for a return.

Tell me if I’m on the wrong track. My better intuition tells me that I am. LOL.


If you’re ad/malware/spyware domains to, then no, you don’t need a dummy http server.

Since a domain is set to resolve to your localhost IP, there is no timeout since it does actually resolves to a valid IP in under a millisecond.

Now, there are some cases where something in the javascript code is waiting on a response from a particular domain, but there’s not much you can do in that case. Those situations will just lead to a timeout in either case. However, the adblocker or adblocker plus browser extension will usually take care of that issue.

Hmmmm…Ok. But I guess I’m wondering past the resolving to a valid IP.

Help me dust this part of my brain off.

Even in the TCP case (http connections, etc.), having the ip resolve doesn’t mean that a connection was established. I understand how TCP is a guaranteed delivery mechanism for the data, but does that the initial connection error returns immediately? I forget.

And I guess I’m also thinking back: all UDP programming (I’m assuming flash?—but for any rouge application outside the browser) I’ve ever seen wait for a return of some kind to know that at the very least the initial contact has arrived properly. If a dummy return shows up, (say blank) it would give that mechanism a chance to error out rather than sit waiting. No?

Or does it make it worse for the majority of UDP implementations that would look at that as an endless invitation for retries?

Of course in the UDP case I’d have to hang on basically /all/ the ports unless I wrote something at the raw IP level, which I haven’t done is so long I’d dare not try it. I think I’m answering all my own questions here.

You can check the state of the TCP/UDP connections with TCPview and/or Wireshark.

After the domain lookup, the browser would send an HTTP request, which starts off with a TCP SYN request, but localhost never responds to with a SYN-ACK to establish the connection (since there wouldn’t be anything listening for a TCP request for port 80). Since the TCP connection is never established, the connection attempt just times out within 3 seconds.

Meanwhile, in the browser, since nothing is displayed until there is a response from the HTTP request (the HTTP request could be for an image file, css file, javascript file, etc), nothing continues to be displayed during and after a failed HTTP connection.

Are the TCP requests within a page issued concurrently? Or is one waiting for the 3 second timeout of the previous one, etc.

For the most part, requests to files in the <head> to the same domain are sequential. Requests in the <head> to different domains are concurrent.

Everything linked in the body is loaded concurrently (images, iframes, etc).

Check out the firebug extension for firefox, and use the net panel. That will show you what a page is loading for each HTTP request. You’ll also see what happens to request to domains when those domains are blocked in the hosts file.

Well, here are the results of the firefox control panel (if that’s good enough). I ran this on the last “stuttering” website.:

Look at the for example----it’s set to and requires nearly a second to time out. B[/B]

[15:51:08.723] GET;dcopt=ist;pos=atf;tile=1;sz=728x90;ord=5586386764682946? [undefined 953ms]
[15:51:09.684] GET [HTTP/1.1 200 OK 110ms]
[15:51:09.837] GET [HTTP/1.1 200 OK 140ms]
[15:51:10.042] GET [HTTP/1.1 200 OK 94ms]
[15:51:10.178] GET [HTTP/1.1 200 OK 141ms]
[15:51:10.391] GET;sz=728x90;ord=5586386764682946? [undefined 1000ms]
[15:51:11.433] GET«%20How-To%20Geek%20Forums& [HTTP/1.1 302 Moved Temporarily 156ms]
[15:51:11.438] GET [undefined 1063ms]
[15:51:11.577] GET«%20How-To%20Geek%20Forums& [HTTP/1.1 204 No Content 63ms]
[15:51:12.527] GET [HTTP/1.1 200 OK 3156ms]
[15:51:12.531] GET [HTTP/1.1 200 OK 125ms]
[15:51:12.535] GET [HTTP/1.1 200 OK 3188ms]