src/test/java/org/jsoup/integration/UrlConnectTest.java
/*
     Proxy tests. Assumes local proxy running on 8888, without system propery set (so that specifying it is required).
     */
Proxy tests. Assumes local proxy running on 8888, without system propery set (so that specifying it is required).
Proxy tests . Assumes local proxy running on 8888 without system propery set ( so that specifying it is required ) .
@Test
    public void fetchViaHttpProxy() throws IOException {
        String url = "https://jsoup.org";
        Proxy proxy = new Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved("localhost", 8888));
        Document doc = Jsoup.connect(url).proxy(proxy).get();
        assertTrue(doc.title().contains("jsoup"));
    }
@ Test public void fetchViaHttpProxy ( ) throws IOException { String url = "https://jsoup.org" ; Proxy proxy = new Proxy ( Proxy . Type . HTTP , InetSocketAddress . createUnresolved ( "localhost" , 8888 ) ) ; Document doc = Jsoup . connect ( url ) . proxy ( proxy ) . get ( ) ; assertTrue ( doc . title ( ) . contains ( "jsoup" ) ) ; }
Proxy tests.
Proxy tests .