0

I'm using Spring Boot 2.6.7 and I want to create an actuator endpoint, that acts as a proxy, and forwards all requests to a different server, running on the same JVM instance, but on a different port (say 8082). Here's the gist of it:

@Component
@RestControllerEndpoint(id = "myEndpoint", enableByDefault = true)
public class MyEndpoint {


    @RequestMapping("**") 
    public Object myEndpoint() {
        // TODO Forward everything to port 8082
        return ...
    }
}

What do I need to do in order to achieve this?

Update 1:

The port (8082) is not available from the internet so I can't do a simple redirect.

Johan
  • 33,352
  • 29
  • 126
  • 209

0 Answers0