Class LatencyFilter

  • All Implemented Interfaces:
    org.littleshoot.proxy.HttpFilters

    public class LatencyFilter
    extends org.littleshoot.proxy.HttpFiltersAdapter
    Adds latency to a response before sending it to the client. This filter always adds the specified latency, even if the latency between the proxy and the remote server already exceeds this value.
    • Field Summary

      • Fields inherited from class org.littleshoot.proxy.HttpFiltersAdapter

        ctx, NOOP_FILTER, originalRequest
    • Constructor Summary

      Constructors 
      Constructor Description
      LatencyFilter​(io.netty.handler.codec.http.HttpRequest originalRequest, int latencyMs)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.handler.codec.http.HttpObject proxyToClientResponse​(io.netty.handler.codec.http.HttpObject httpObject)  
      • Methods inherited from class org.littleshoot.proxy.HttpFiltersAdapter

        clientToProxyRequest, proxyToServerConnectionFailed, proxyToServerConnectionQueued, proxyToServerConnectionSSLHandshakeStarted, proxyToServerConnectionStarted, proxyToServerConnectionSucceeded, proxyToServerRequest, proxyToServerRequestSending, proxyToServerRequestSent, proxyToServerResolutionFailed, proxyToServerResolutionStarted, proxyToServerResolutionSucceeded, serverToProxyResponse, serverToProxyResponseReceived, serverToProxyResponseReceiving, serverToProxyResponseTimedOut
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LatencyFilter

        public LatencyFilter​(io.netty.handler.codec.http.HttpRequest originalRequest,
                             int latencyMs)
    • Method Detail

      • proxyToClientResponse

        public io.netty.handler.codec.http.HttpObject proxyToClientResponse​(io.netty.handler.codec.http.HttpObject httpObject)
        Specified by:
        proxyToClientResponse in interface org.littleshoot.proxy.HttpFilters
        Overrides:
        proxyToClientResponse in class org.littleshoot.proxy.HttpFiltersAdapter