Using spring-boot
and jetty
, I'd like to be able to configure my application to listen on additional ports, which are programmatically added at runtime (+ removed?).
What I've tried:
I've followed this tutorial, which allows me to listen on multiple ports. This works perfectly, but unfortunately only works at startup only.
I've tried @Autowiring
a org.eclipse.jetty.server.Server
class into a service, so that I can add connectors - I got the error No qualifying bean of type [org.eclipse.jetty.server.Server] found ...
build.gradle (dependencies
buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.6.RELEASE")
}
}
apply plugin: 'spring-boot'
...
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile "org.springframework.boot:spring-boot-starter-jetty"
compile "org.eclipse.jetty:jetty-proxy:9.2.17.v20160517"
...
Not sure what to try from here...