Provided that I have a video HTTP stream broadcasted on a server that is on the same network as my Spring Webserver is, for instance in some url such as:
How can I proxy this video stream to any amount of clients, using Spring? The following example demonstrates the wanted flow:
- Spring webserver can be found at http://localhost:9091/spring
- A client wants to access a video stream, so he connects his video-stream-player to http://localhost:9091/spring (the spring webserver)
- The Spring WebServer should redirect the stream found on http://localhost:9090/httpstream to the client, with the latter never knowing that he accessed the httpstream host. The connection is made by Spring, not by the client
This is needed because the HTTPStream is an unsecured and not authenticated host, and I wanted to wrap it around a Spring Webserver, so that I could use some form of Security, such as a Basic Auth.
I tried requesting some form of mapping, but I couldn't find what kind of object to return, nor how to make the connection, but the expected behaviour should be something like this:
@Controller
public class HttpStreamProxyController {
@RequestMapping("/spring") {
public /*Stream Object?*/ getSecuredHttpStream() {
if (clientIsSecured) {
//... Security information
return //What should be returned?
}
}
}