Is there an example for utilization of WebSockets

2019-06-14 19:17发布

问题:

Is there somewhere an example that utilizes this websocket implementation for JBoss Application Server > 7.1.2 https://github.com/mikebrock/jboss-websockets

I can't get it to work with the brief description thats there.

I've already setup the WebSocketServlet and bound it to an address and then when I'm trying to connect to the Servlet from the Browser (newest stable Chrome) over ws:// it fails (405 access not allowed) and over wss:// nothing happens , it stays in the connecting state and does not throw any errors on client or server side.

And if there's another way to implement websocket servlets I would be even happier. I also saw that you can get it running with Jetty described in here:
http://golovnin.blogspot.de/2012/04/jboss-7-and-websockets.html,
but I'd rather do it the other way.

回答1:

I've made a demo app here: https://github.com/eis/jboss-websocket-demo

It's a simple chat.

It uses JBoss stuff only, not Jetty or other workarounds. Like readme says, you need to enable native jbossweb.