Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] HTTP on LAN and redirect to HTTPS on WAN?

Looks like I'm close. I also want to be able to add authentication that will only apply to WAN use. Is there an easy way to do that? Authentication is set on the context which applies to both connectors.


                  final SslSelectChannelConnector sslCnct = new SslSelectChannelConnector(sslCnxt);



                  final SelectChannelConnector httpCnct = new SelectChannelConnector();




                  server.setConnectors(new Connector[] { httpCnct, sslCnct });


From: Will Hoover [mailto:java.whoover@xxxxxxxxx]
Sent: Thursday, September 27, 2012 10:32 AM
To: 'jetty-users@xxxxxxxxxxx'
Subject: HTTP on LAN and redirect to HTTPS on WAN?


What's the simplest way to setup Jetty 8 to allow HTTP on LAN and redirect to HTTPS on WAN? I have the HTTPS working, but I need to know the easiest way to allow HTTP on LAN.


                  final EnumSet<DispatcherType> dispatchers = EnumSet.range(

                              DispatcherType.FORWARD, DispatcherType.ERROR);

                  final ServletContextHandler context = new ServletContextHandler(



                  context.addFilter(GlobalFilter.class, "/*", dispatchers);

                  context.addServlet(DefaultAppServlet.class, "/");





Back to the top