利用Java实现反向代理
最近有个需求要做一个反向代理,在GitHub上找到了一个已实现好了的项目,记录一下,传送门:https://github.com/mitre/HTTP-Proxy-Servlet
引入依赖
<dependency>
<groupId>org.mitre.dsmiley.httpproxy</groupId>
<artifactId>smiley-http-proxy-servlet</artifactId>
<version>1.11</version>
</dependency>
添加配置
proxy:
solr:
servlet_url: /solr/*
target_url: http://solrserver: