users@tyrus.java.net

Using tyrus to run standalone websocket Server : Connectivity issues

From: <singh.kr.vivek_at_gmail.com>
Date: Mon, 24 Jun 2013 16:56:48 +0000 (UTC)

Hi,
I am using tyrus in stand-alone mode to create a new websocket server
instance.

Using programatic way of server creation I believe the end point should
be ws://localhost:8025/websockets/tests

When trying to connect using ClientManager.connectToClient(...), server
returns a 404 error.

public class EchoWebSocketEndpoint extends Endpoint {

        @Override
        public void onOpen(Session session, EndpointConfig config) {
                final RemoteEndpoint.Basic endPoint =
session.getBasicRemote();

                session.addMessageHandler(new
MessageHandler.Whole<String>() {
                        @Override
                        public void onMessage(String message) {
                                try {
                                       
endPoint.sendText(System.currentTimeMillis() + " " + message);
                                } catch (IOException e) {
                                        e.printStackTrace(); //To
change body of catch statement use File | Settings | File Templates.
                                }
                        }
                });


        }
}

Server End Point Code is located at
https://github.com/mail2vks/tyrus-sample/blob/master/src/main/java/org/
vivek/j2ee/websockets/server/EchoWebSocketEndpoint.java

If this mailing list is not the right place, kindly guide me to
appropriate list.