In many cases, you can specify a proxy to use with the proxy: {} option. While each browser driver handles this slightly differently, the following format works in Chrome or Firefox.
Example: using a proxy in Chrome or Firefox
Be sure to specify both :http and :ssl to route both types of traffic through your proxy.
Under the hood, this is passing options to create a Selenium::WebDriver::Proxy object.
Example: setting a http and https proxy for Remote Chrome