Friday, January 31, 2020

reverse proxy in java

Several proxy server implementations are available in Java, but I found following lib is pretty useful.
https://github.com/mitre/HTTP-Proxy-Servlet

we can put the class in servlet and edit web.xml, no source code need to be changed.
using this, we can delegate pdf generation from servlet to node server.

---

Here's an example excerpt of a web.xml file to communicate to a Solr server:
<servlet>
    <servlet-name>solr</servlet-name>
    <servlet-class>org.mitre.dsmiley.httpproxy.ProxyServlet</servlet-class>
    <init-param>
      <param-name>targetUri</param-name>
      <param-value>http://solrserver:8983/solr</param-value>
    </init-param>
    <init-param>
      <param-name>log</param-name>
      <param-value>true</param-value>
    </init-param>
</servlet>
<servlet-mapping>
  <servlet-name>solr</servlet-name>
  <url-pattern>/solr/*</url-pattern>
</servlet-mapping>
--

we may further combin(or replace) this with rust's proxy based on tokio and headless chrome to generate pdf.

No comments:

Post a Comment

Recursive Matrix and the parallel matrix multiplication using crossbeam and generic constant

This was planned project I posted before. Basically in order to evaluate Rust's claim for zero cost abstraction and the effectiveness o...