Skip to content

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Mar 1, 2019

The log message now looks like:

Quarkus 1.0.0.Alpha1-SNAPSHOT started in 0.589s. Listening on: http://127.0.0.1:8080

@mkouba mkouba requested review from dmlloyd and rsvoboda March 1, 2019 14:07
@mkouba mkouba force-pushed the issue-1044-http-config branch from 14bb224 to ad650c3 Compare March 1, 2019 14:09
Copy link
Member

@rsvoboda rsvoboda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried examples

$ java -Dquarkus.http.host=0.0.0.0 -jar target/servletdemo-runner.jar
2019-03-01 23:27:08,646 INFO  [io.quarkus] (main) Quarkus 1.0.0.Alpha1-SNAPSHOT started in 0.514s.
   Listening on: http://0:0:0:0:0:0:0:0:8080
2019-03-01 23:27:08,649 INFO  [io.quarkus] (main) Installed features: [cdi]
^C2019-03-01 23:27:10,979 INFO  [io.quarkus] (main) Quarkus stopped in 0.012s

$ java -Dquarkus.http.host=0.0.0.0 -Djava.net.preferIPv4Stack=true -jar target/servletdemo-runner.jar
2019-03-01 23:27:16,117 INFO  [io.quarkus] (main) Quarkus 1.0.0.Alpha1-SNAPSHOT started in 0.550s.
   Listening on: http://0.0.0.0:8080
2019-03-01 23:27:16,120 INFO  [io.quarkus] (main) Installed features: [cdi]
^C2019-03-01 23:27:18,257 INFO  [io.quarkus] (main) Quarkus stopped in 0.010s

$ java -Dquarkus.http.host=192.168.1.132 -jar target/servletdemo-runner.jar
2019-03-01 23:27:39,388 INFO  [io.quarkus] (main) Quarkus 1.0.0.Alpha1-SNAPSHOT started in 0.497s.
   Listening on: http://192.168.1.132:8080
2019-03-01 23:27:39,391 INFO  [io.quarkus] (main) Installed features: [cdi]
^C2019-03-01 23:27:42,171 INFO  [io.quarkus] (main) Quarkus stopped in 0.011s

@dmlloyd
Copy link
Member

dmlloyd commented Mar 1, 2019

That first one looks a bit funny; if we insist on rendering these things as URLs we should definitely use org.wildfly.common.net.Inet#toURLString(java.net.InetAddress, boolean). It would render the above as [::] instead of the much uglier (and anyway invalid, at least in a URL) 0:0:0:0:0:0:0:0.

@starksm64
Copy link
Contributor

@dmlloyd Do you want that change to use Inet#toURLString(java.net.InetAddress, boolean before merging this?

@dmlloyd
Copy link
Member

dmlloyd commented Mar 2, 2019

Yeah let's fix that, so the URLs are at least valid.

@starksm64 starksm64 self-requested a review March 2, 2019 20:14
@starksm64
Copy link
Contributor

@mkouba Martin, and you add that change so I can merge this?

String address;
if (l.getAddress() instanceof InetSocketAddress) {
InetSocketAddress inetAddress = (InetSocketAddress) l.getAddress();
address = inetAddress.getHostString() + ":" + inetAddress.getPort();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this line should be:
address = Inet.toURLString(addr, true) + ":" + inetAddress.getPort();

@mkouba mkouba merged commit 2f538a9 into quarkusio:master Mar 3, 2019
@gsmet gsmet added this to the 0.11.0 milestone Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Customized quarkus.http.host not reflected in "Listening on" log message

6 participants