wolfwings: (Default)
[personal profile] wolfwings
...managed to port that source code from earlier to a Windows Service that behaves correctly, though it only supports Start/Stop, I couldn't think of a sane state to handle Pause/Resume since there's no solid answer to 'should a web server finish existing requests, close existing requests, or just 'hang' existing requests when paused?' that I could find.

Still, pleased with myself, now to work on a DNS filter that'll automatically integrate itself into the existing network stack, and then integrate that with the main program so it'll be a single executable/service to deal with. Then comes the hard part: Adding configuration screens to adding new domain-names to block like this.

I think there might actually be a market for this sort of thing, if I can manage to make it not break corporate Windows networking's wierd DNS requirements and what-not.
From: [identity profile] wolfwings.livejournal.com
In this case, it actively ignores the actual request, and sends back a single reply regardless of URL asked for, a 1x1-pixel transparent GIF. Supporting pause/resume is optional, so I decided against doing so since it would have noticably enlarged a very tiny, very compact service.

In this case, the compiled executable is only 8kB in size actually, despite obeying ALL Windows semantics and steps to do WinSock calls, handle Windows errors cleanly if abruptly, and provide minimal logging to the Event Log when it starts up and shuts down.

Style Credit