package de.tutorials.training.fx.proxy; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage; import java.net.InetSocketAddress; import java.net.Proxy; /** * @author Thomas Darimont */ public class ProxyProblemExample extends Application { @Override public void start(Stage stage) throws Exception { StackPane root = new StackPane(); WebView view = new WebView(); WebEngine engine = view.getEngine(); engine.load("https://www.google.com"); root.getChildren().add(view); Scene scene = new Scene(root, 960, 640); stage.setScene(scene); stage.show(); } public static void main(String[] args) throws Exception { Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(System.getProperty("hack.webkit.http.proxy"), Integer.getInteger("hack.webkit.http.proxyPort"))); URLStreamFactoryCustomizer.useDedicatedProxyForWebkit(proxy, "http, https"); Application.launch(ProxyProblemExample.class); } }