Look at the documentation page.
Tweaking an existing Firefox profile
You need to change "network.proxy.http" & "network.proxy.http_port" profile settings.
FirefoxProfile profile = new FirefoxProfile();
profile.addAdditionalPreference("network.proxy.http", "localhost");
profile.addAdditionalPreference("network.proxy.http_port", "3128");
WebDriver driver = new FirefoxDriver(profile);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…