File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
main/java/top/meethigher/proxy/http Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ protected Handler<RoutingContext> routingContextHandler(HttpClient httpClient) {
454
454
String absoluteURI = realReq .absoluteURI ();
455
455
UrlParser .ParsedUrl parsedUrl = UrlParser .parseUrl (absoluteURI );
456
456
String prefix = parsedUrl .getFormatHostPort () + (route .getMetadata (P_SOURCE_URL ).toString ().replace ("/*" , "" ));
457
- String realUrl = result + (absoluteURI .replace (prefix , "" ));
457
+ String realUrl = result + (parsedUrl . getFormatUrl () .replace (prefix , "" ));
458
458
459
459
460
460
// 构建请求参数
Original file line number Diff line number Diff line change @@ -25,4 +25,21 @@ public void testVertxHTTPReverseProxyTest() throws Exception {
25
25
proxy .stop ();
26
26
}
27
27
28
+
29
+ @ Test
30
+ public void testDomain80 () throws Exception {
31
+ Vertx vertx = Vertx .vertx ();
32
+ ReverseHttpProxy proxy = ReverseHttpProxy .create (
33
+ vertx
34
+ );
35
+ proxy .port (80 );
36
+ proxy .start ();
37
+ ProxyRoute proxyRoute = new ProxyRoute ();
38
+ proxyRoute .setSourceUrl ("/*" );
39
+ proxyRoute .setTargetUrl ("http://127.0.0.1:4000" );
40
+ proxy .addRoute (proxyRoute );
41
+ TimeUnit .MINUTES .sleep (2 );
42
+ proxy .stop ();
43
+ }
44
+
28
45
}
You can’t perform that action at this time.
0 commit comments