3redronin / murp Goto Github PK
View Code? Open in Web Editor NEWA reverse proxy handler for Mu Server
License: MIT License
A reverse proxy handler for Mu Server
License: MIT License
With UriMapper
one can check details (auth header for example) of the client request by examine the MuRequest
argument, and throw WebApplicationException
in uri mapper, but this sounds not very intuitive. To catch and re-throw WebApplicationException
in RequestInterceptor
looks better.
Index: src/main/java/io/muserver/murp/ReverseProxy.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/io/muserver/murp/ReverseProxy.java b/src/main/java/io/muserver/murp/ReverseProxy.java
--- a/src/main/java/io/muserver/murp/ReverseProxy.java (revision df2abae1736303d2b6d617fdcfb02ac582e71235)
+++ b/src/main/java/io/muserver/murp/ReverseProxy.java (date 1702447573220)
@@ -4,6 +4,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.WebApplicationException;
import java.net.InetAddress;
import java.net.URI;
import java.net.http.HttpClient;
@@ -291,6 +292,9 @@
if (requestInterceptor != null) {
try {
requestInterceptor.intercept(clientRequest, targetReq);
+ } catch (WebApplicationException webEx) {
+ log.error("requestInterceptor error", webEx);
+ throw webEx;
} catch (Throwable throwable) {
log.info("requestInterceptor error", throwable);
clientResponse.status(500);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.