Hi team,

Just wondering whether anyone has successfully implemented a serverside
WebSocket endpoint as a Tapestry service?  The beauty of implementing it
as a Tapestry service is that I could then easily PUSH messages out from
other parts of the program, via the injected service.

The client is not a browser, but a Java desktop application running Tyrus
Standalone (Grizzly).  The problem is that when the clent app attempts to
connect, the response is a 200 not 101, suggesting the request is not
being upgraded from HTTP protocol to WS protocol.

Both serverside and clientside endpoint code appears correct.  Just trying
to work out whether the problem is with Tapestry or Tomcat.

Serverside endpoint:

    @ServerEndpoint(value = "/websocket/{port-name}/{username}", encoders
= MessageEncoder.class, decoders = MessageDecoder.class)

Clientside connection URI:

    ws://the_url.com:8080/harbour/websocket

AppModule.java contains:
    public static void contributeIgnoredPathsFilter(Configuration<String>
configuration) {
        configuration.add("/websocket");
    }

Tomcat log:

    [15/Mar/2019:14:36:41 +1300] "GET /harbour/websocket HTTP/1.1" 302 -
    [15/Mar/2019:14:36:41 +1300] "GET /harbour/signin/Error404 HTTP/1.1"
200 7181

Clientside error:

    An error occurred: java.lang.RuntimeException:
javax.websocket.DeploymentException: Handshake error.
    Caused by: javax.websocket.DeploymentException: Handshake error.
    Caused by: org.glassfish.tyrus.core.HandshakeException: Response code
was not 101: 200.

On the face of it, it appears that Tapestry is not ignoring the URI as
directed in AppModule.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to