Jetty ProxyServlet with SSL support

前端 未结 3 1426
一个人的身影
一个人的身影 2020-12-09 22:06

I am using Jetty\'s ProxyServlet as a HTTP proxy.

After I start the server and add the socks proxy in firefox I can access websites through the proxy without any pro

3条回答
  •  一个人的身影
    2020-12-09 22:29

    I'm using the latest release of Jetty currently (9.4.1) and I was able to get HTTPS proxy working by simply adding this to my Proxy Servlet:

    @Override
    protected HttpClient newHttpClient() {        
        return new HttpClient(new SslContextFactory());
    }
    

    Credit to k2k2e6's example which I started with before realizing I could just override this simple method instead of the entire createHttpClient() method.

提交回复
热议问题