Package io.jmix.flowui.devserver
Class ViteWebsocketProxy
java.lang.Object
io.jmix.flowui.devserver.ViteWebsocketProxy
- All Implemented Interfaces:
jakarta.websocket.MessageHandler
,jakarta.websocket.MessageHandler.Whole<String>
public class ViteWebsocketProxy
extends Object
implements jakarta.websocket.MessageHandler.Whole<String>
Connects a brower-server websocket connection with a server-Vite websocket
connection.
Forwards all messages from one to the other.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionViteWebsocketProxy
(jakarta.websocket.Session browserSession, Integer vitePort, String vitePath) Creates a new proxy for the given browser-server websocket connection. -
Method Summary
-
Constructor Details
-
ViteWebsocketProxy
public ViteWebsocketProxy(jakarta.websocket.Session browserSession, Integer vitePort, String vitePath) throws InterruptedException, ExecutionException Creates a new proxy for the given browser-server websocket connection.Opens a connection to the Vite server running on the given port and starts forwarding messages.
- Parameters:
browserSession
- the websocket connection from the browservitePort
- the port the Vite server is running onvitePath
- the path Vite is using- Throws:
ExecutionException
- if there is a problem with the connectionInterruptedException
- if there is a problem with the connection
-
-
Method Details
-
getLogger
protected org.slf4j.Logger getLogger() -
onMessage
- Specified by:
onMessage
in interfacejakarta.websocket.MessageHandler.Whole<String>
-
close
public void close()Terminates the connection.
-