org.eclipse.jetty.rewrite.handler

## Class ProxyRule

- java.lang.Object
- - org.eclipse.jetty.rewrite.handler.Rule
  - - org.eclipse.jetty.rewrite.handler.PatternRule
    - - org.eclipse.jetty.rewrite.handler.ProxyRule

-     public class ProxyRule
      extends PatternRule

  This rule allows the user to configure a particular rewrite rule that will proxy out to a configured location. This rule uses the jetty http client. Rule rule = new ProxyRule(); rule.setPattern("/foo/*"); rule.setProxyTo("http://url.com"); see api for other configuration options which influence the configuration of the jetty client instance

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule

      `Rule.ApplyURI`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.jetty.rewrite.handler.PatternRule

      `_pattern`

    - ### Fields inherited from class org.eclipse.jetty.rewrite.handler.Rule

      `_handling, _terminating`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProxyRule()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDontProxyHeaders(String dontProxyHeader)`
    `protected String` | `apply(String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Apply the rule to the request
    `String` | `getHostHeader()`
    `void` | `setConnectorType(int connectorType)` CONNECTOR_SOCKET = 0; CONNECTOR_SELECT_CHANNEL = 2; (default)
    `void` | `setHostHeader(String hostHeader)`
    `void` | `setIdleTimeout(String idleTimeout)`
    `void` | `setMaxConnections(String maxConnections)`
    `void` | `setMaxThreads(String maxThreads)`
    `void` | `setProxyTo(String proxyTo)`
    `void` | `setRequestBufferSize(String requestBufferSize)`
    `void` | `setRequestHeaderSize(String requestHeaderSize)`
    `void` | `setResponseBufferSize(String responseBufferSize)`
    `void` | `setResponseHeaderSize(String responseHeaderSize)`
    `void` | `setTimeout(String timeout)`

    - ### Methods inherited from class org.eclipse.jetty.rewrite.handler.PatternRule

      `getPattern, matchAndApply, setPattern, toString`

    - ### Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule

      `isHandling, isTerminating, setHandling, setTerminating`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ProxyRule

          public ProxyRule()

  - ### Method Detail

    - #### apply

          protected String apply(String target,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
                          throws IOException

      Description copied from class: `PatternRule`
      Apply the rule to the request
      Specified by:
        `apply` in class `PatternRule`
      Parameters:
        `target` - field to attempt match
        `request` - request object
        `response` - response object
      Returns:
        The target (possible updated)
      Throws:
        `IOException` - exceptions dealing with operating on request or response objects

    - #### setProxyTo

          public void setProxyTo(String proxyTo)

    - #### setMaxThreads

          public void setMaxThreads(String maxThreads)

    - #### setMaxConnections

          public void setMaxConnections(String maxConnections)

    - #### setTimeout

          public void setTimeout(String timeout)

    - #### setIdleTimeout

          public void setIdleTimeout(String idleTimeout)

    - #### setRequestHeaderSize

          public void setRequestHeaderSize(String requestHeaderSize)

    - #### setRequestBufferSize

          public void setRequestBufferSize(String requestBufferSize)

    - #### setResponseHeaderSize

          public void setResponseHeaderSize(String responseHeaderSize)

    - #### setResponseBufferSize

          public void setResponseBufferSize(String responseBufferSize)

    - #### addDontProxyHeaders

          public void addDontProxyHeaders(String dontProxyHeader)

    - #### setConnectorType

          public void setConnectorType(int connectorType)

      CONNECTOR_SOCKET = 0; CONNECTOR_SELECT_CHANNEL = 2; (default)
      Parameters:
        `connectorType` -

    - #### getHostHeader

          public String getHostHeader()

    - #### setHostHeader

          public void setHostHeader(String hostHeader)

Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.