We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87c5851 commit 415f502Copy full SHA for 415f502
src/main/java/org/browsermob/proxy/bricks/ProxyResource.java
@@ -43,9 +43,15 @@ public Reply<ProxyDescriptor> newProxy(Request request) throws Exception {
43
options.put("httpProxy", httpProxy);
44
}
45
46
- ProxyServer proxy = proxyManager.create(options);
47
- int port = proxy.getPort();
48
-
+ String paramPort = request.param("port");
+ int port = 0;
+ if (paramPort != null) {
49
+ port = Integer.parseInt(paramPort);
50
+ ProxyServer proxy = proxyManager.create(options, port);
51
+ } else {
52
+ ProxyServer proxy = proxyManager.create(options);
53
+ port = proxy.getPort();
54
+ }
55
return Reply.with(new ProxyDescriptor(port)).as(Json.class);
56
57
0 commit comments