Uh oh!
There was an error while loading. Please reload this page.
Websocket support - #360
Conversation
coveralls
commented
Apr 20, 2017
coveralls
commented
Apr 20, 2017
coveralls
commented
Apr 20, 2017
coveralls
commented
Apr 20, 2017
Move PippoFilter instantiation from Pippo class to the WebServer implementations (breaking change)
coveralls
commented
Apr 22, 2017
…ocket is present as dependency
decebals
commented
Apr 22, 2017
See #279 (comment) for more details. |
coveralls
commented
Apr 22, 2017
mhagnumdw
commented
Apr 23, 2017
Hello, Decebals! The dependency org.eclipse.jetty.websocket:websocket-server is optional after your commit 7c4c069. How to tell maven to add this dependency so that JettyServer.java add the JettyWebSocketFilter filter instead of PippoFilter? |
decebals
commented
Apr 23, 2017
@mhagnumdw The advantages are:
A new You can see parts from this demo in this Gist. The websocket support is implemented only for Jetty in this moment. |
mhagnumdw
commented
Apr 23, 2017
Thanks for the answer. I had already done so. I just find it a bit strange because the developer can specify a version for the org.eclipse.jetty.websocket: websocket-server that conflicts with the version of the Jetty server shipped in Pippo, right? Is there a way for the developer not to specify the version so that it is obtained from the Jetty server version used by Pippo? I went crazy? :) Other inquiries,
PS: Is it better to address these issues here or in the mailing list? |
They are some situations when you want to access some details information in your addWebSocket("/ws-debug", (webSocketContext, message) -> {
WebSocketConnectionconnection = webSocketContext.getConnection();
// cast WebSocketConnection to JettyWebSocketConnectionJettyWebSocketConnectionjettyConnection = (JettyWebSocketConnection) connection;
StringremoteAddress = jettyConnection.getRemoteAddress().toString();
System.out.println("remoteAddress = " + remoteAddress);
org.eclipse.jetty.websocket.api.Sessionsession = jettyConnection.getSession();
StringprotocolVersion = session.getProtocolVersion();
System.out.println("protocolVersion = " + protocolVersion);
org.eclipse.jetty.websocket.api.UpgradeRequestupgradeRequest = session.getUpgradeRequest();
// upgradeRequest.getCookies();// upgradeRequest.getHeaders();// upgradeRequest.getParameterMap();Stringquery = upgradeRequest.getQueryString();
System.out.println("query = " + query);
});Now, if I make a request from a websocket client (I used That it's all, simple and straightforward 😄 |
decebals
commented
Apr 23, 2017
@mhagnumdw
I think that you can.
I don't know what involves this. Can you add more details about your use case? |
coveralls
commented
Apr 23, 2017
decebals
commented
Apr 23, 2017
Other solution is to use the websocket hook methods |
mhagnumdw
commented
Apr 23, 2017
I have a periodic schedule made by java.util.concurrent.ScheduledExecutorService. This asynchronous task collects some data that application users should be aware of. To achieve this, I imagined this asynchronous task to post the messages and get them to the client via websocket (so the client / user does not have to keep giving F5 on the screen for news!). |
decebals
commented
Apr 23, 2017
@mhagnumdw |
mhagnumdw
commented
Apr 24, 2017
@decebals |
It's the successor of #279. All information presented in #279 are available.