question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose a way to get http port in run()

See original GitHub issue

In dropwizard 0.6 you could get the http port from the configuration in the run() method with configuration.getHttpConfiguration().getPort(). In 0.7.x this isn’t accessible.

We tried using jetty’s connectors, but it hasn’t started yet in run(), so we can’t use that. Are there any other ways of getting the port?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jplockcommented, Oct 17, 2014

Technically, if a user specifies an httpPort of 0 for a random port, I had to something like this https://github.com/dropwizard/dropwizard-discovery/blob/master/src/main/java/io/dropwizard/discovery/core/CuratorAdvertisementListener.java to actually get the listening port from jetty upon startup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get the Running Port in Spring Boot - Baeldung
Usually, the most straightforward way to configure the HTTP port of a Spring Boot application is by defining the port in the configuration ......
Read more >
How do I expose Web API on different port than default? .NET 6
From cmd.exe use >Netstat -a and check to see if port is already used by another application. – jdweng. Jan 20 at 11:13....
Read more >
Enable ports 80 (HTTP) and 443 (HTTPS) - PaperCut
Enable ports 80 (HTTP) and 443 (HTTPS). By default, PaperCut NG/MF listens to ports 9191 and 9192 for HTTP and HTTPS communication respectively....
Read more >
How to automatically choose a free port in ASP.NET Core 3.0
The typical approach is to expose an HTTP or TCP endpoint that the Kubernetes infrastructure can call, to verify the application hasn't crashed....
Read more >
How to run a server on port 80 as a normal user on Linux?
Short answer: you can't. Ports below 1024 can be opened only by root. As per comment - well, you can, using CAP_NET_BIND_SERVICE, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found