How to initialise Webdriver and RemoteWebdriver with custom Proxy

This example described how to use proxy in IE, Chrome and Firefox for WebDriver and RemoteWebDriver
also in this example shown how to set proxy for Firefox via profile and Chrome via options
Please add additional info about purpose of this code and tools / libraries you're using.
Also it would be nice to see a test example here.