public class HttpToHttpsRedirector extends Object implements AsyncMuHandler
Add as an async handler to enable. Sample usage:
server = MuServerBuilder.muServer() .withHttpConnection(8080) .withHttpsConnection(80443, SSLContextBuilder.unsignedLocalhostCert()) .addAsyncHandler(new HttpToHttpsRedirector(80443)) .addHandler( ... your handler ... ) .start();
Constructor and Description |
---|
HttpToHttpsRedirector(int httpsPort)
Creates a HTTPS redirector
|
Modifier and Type | Method and Description |
---|---|
boolean |
onHeaders(AsyncContext ctx,
Headers headers) |
void |
onRequestComplete(AsyncContext ctx) |
void |
onRequestData(AsyncContext ctx,
ByteBuffer buffer) |
public HttpToHttpsRedirector(int httpsPort)
httpsPort
- The port that HTTPS is running onpublic boolean onHeaders(AsyncContext ctx, Headers headers) throws Exception
onHeaders
in interface AsyncMuHandler
Exception
public void onRequestData(AsyncContext ctx, ByteBuffer buffer) throws Exception
onRequestData
in interface AsyncMuHandler
Exception
public void onRequestComplete(AsyncContext ctx)
onRequestComplete
in interface AsyncMuHandler
Copyright © 2017–2018. All rights reserved.