Skip to content

Instantly share code, notes, and snippets.

@kylestev
Created May 23, 2012 03:37
Show Gist options
  • Select an option

  • Save kylestev/2773128 to your computer and use it in GitHub Desktop.

Select an option

Save kylestev/2773128 to your computer and use it in GitHub Desktop.
Fiddler Netflix blocker using HostList class
import Fiddler;
class Handlers {
static var nopeGif = "<img src=\"http://i.imgur.com/OLRXz.gif\" />";
static var blocked = "<html><head><title>Blocked</title></head><body><h2>Blocked</h2><p>Stop using all my bandwidth!!</p><br />" + nopeGif + "</body></html>";
static var hostList = new HostList("*.netflix.com,*.nflximg.com");
static function OnBeforeRequest(oSession: Session) {
if (hostList.ContainsHost(oSession.hostname)) {
oSession["ui-bold"] = "true";
oSession["ui-color"] = "blue";
oSession.oRequest.FailSession(403, "Blocked", blocked);
}
}
}
@kylestev

Copy link
Copy Markdown
Author

@ericlaw thanks! sorry I didn't see this until now. This was from back in high school when I was writing some sample rulesets to show the IT department what Fiddler could do for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment