networking - Redirect specific https requests the way HOST redirects specific http requests

08
2014-07
  • Gordon Edwards

    Ummm... The question How to block specific HTTPS traffic? seems to have an answer somewhere, but...

    What I want is to do to https what hosts does to http, that is, redirect the request to someplace like "home" (127.0.0.1) with a file lookup. 0.0.0.0 would do in this case, provided the timeout isn't too long. I'm currently using eDexter to handle my unwanted http requests. I do have Proxomitron somewhere in my Basement if it's relevant.

    I do not need to do this for the whole LAN, just this box, or any other box that needs it. I'm using W7HPx64, Avast! 7.0.1466 and a Draytek 2710Vn NAT router.

    Gordon.

    EDIT: eDexter and Homer (site is currently down) are proxies which monitor 127.0.0.1 and return a small image to the requesting browser when they detect the traffic referred by hosts, thereby eliminating timeouts and WAN delays. END EDIT

  • Answers
  • bjanssen

    The hosts file is not doing what the question supposes it does. The hosts file only maps hostnames to IPs. As such it only applies to the hostname-portion of any request. It does so completely and utterly independent of the port and/or the higher-layer protocol, in other words, the hosts file has nothing to do with protocol based redirections.


  • Related Question

    windows - Redirect browser to different host and port
  • Questioner

    Background, Running windows 7, FF3.5, and am an admin. I recieve emails from an internal company service that has links. The problem is the links don't work from my office. If the resource is http://sub1.sub2.domain.com/page.html, I need to go to h t t p://so.me.ip:8080/page.html. (spaces in http because i am only allowed one link...)

    The gist is a need to map a domain to an ip AND port. I am open to ideas that are system wide, browser (some kind of plugin?) or even somehow modifying the email as it comes in to outlook. I am pretty technical so don't hold back. Any ideas?


  • Related Answers
  • Dentrasi

    If it was just straight IP mapping, then using your hosts file would do the job fine, but changing the port as well is somewhat more complex. I'm not aware of any local software that would let you do this, what I'd do is to set up a proxy/firewall between you and the remote server (I've used squid in the past, which is also caching), and setting up rewrite rules on there to map one url/port to another.

    If these are links that can be accessed from the internal network normally, then perhaps connecting in with a VPN would be the simplest solution?

  • Forgotten Semicolon

    Are you getting your email via the web or with a client?

    If it is over the web, and because you are using Firefox, you can use the GreaseMonkey AddOn. You will have to code your own script to get what you're asking for, but here is one to get you started: URL fixer

  • Steiv

    I've used the FoxyProxy plugin for FireFox in the past in these situations, and it's worked out pretty well. It lets you map a proxy for FF only, leaving the rest of your network settings in tact.

    Let me know if that works out for you. Good luck!

  • nopuck4you

    Both of the following two applications will do what you want:

    Fiddler (Free) http://www.fiddler2.com/fiddler2/

    Charles Debugging Proxy (Shareware) http://www.xk72.com/charles.

    You can map hosts/ip/url etc with either tool. I just went through the same issue a few days ago.