Skip to content

Commit 100dd29

Browse files
geoandgsmet
authored andcommitted
Make sure that remote-dev mode listens on all interfaces instead of localhost
Fixes: #13638
1 parent 00add0f commit 100dd29

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/runtime/src/main/java/io/quarkus/runtime/LaunchMode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public boolean isDevOrTest() {
2222
return this != NORMAL;
2323
}
2424

25+
public boolean isRemoteDev() {
26+
return (current() == DEVELOPMENT) && "true".equals(System.getenv("QUARKUS_LAUNCH_DEVMODE"));
27+
}
28+
2529
private final String defaultProfile;
2630

2731
LaunchMode(String defaultProfile) {

extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpHostConfigSource.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
public class HttpHostConfigSource implements ConfigSource, Serializable {
1818

1919
public static final String QUARKUS_HTTP_HOST = "quarkus.http.host";
20+
private static final String ALL_INTERFACES = "0.0.0.0";
2021

2122
private final int priority;
2223

@@ -37,7 +38,11 @@ public int getOrdinal() {
3738
@Override
3839
public String getValue(String propertyName) {
3940
if (propertyName.equals(QUARKUS_HTTP_HOST)) {
40-
return LaunchMode.current().isDevOrTest() ? "localhost" : "0.0.0.0";
41+
if (LaunchMode.current().isRemoteDev()) {
42+
// in remote-dev mode we need to listen on all interfaces
43+
return ALL_INTERFACES;
44+
}
45+
return LaunchMode.current().isDevOrTest() ? "localhost" : ALL_INTERFACES;
4146
}
4247
return null;
4348
}

0 commit comments

Comments
 (0)