0

I have the following @serverendpoint path for a websocket that I am using with the spring framework:

@ServerEndpoint(value="/serverendpoint", configurator = SpringConfigurator.class)
  1. My first question is say I have a website with the url www.example.com. Where does the serverendpoint with path serverendpoint get mapped? Can I access my serverendpoint at wss://example.com:$PORT/currentpage.html/serverendpoint? Or is this the wrong way.
  2. I have a Wildfly 10 server running. Based on another SO question, I was told to use the following Uri: var wsUri = "wss://" + document.location.hostname + ":8443" + document.location.pathname + "/../serverendpoint";. However, when I do so, in Google Chrome, I receive the following error:

WebSocket is already in CLOSING or CLOSED state.

My console.log prints that the websocket has been connected, but then I immediately get the above error. What am I doing wrong?

As per the Wildfly server log, I know the serverendpoint was mapped:

[io.undertow.websockets.jsr] (ServerService Thread Pool -- 78) UT026003: Adding annotated server endpoint class com.voice2.spring.web.controller.serverendpoint for path /serverendpoint

So how do I connect to this sever endpoint?

Here is my project file hierarchy:

enter image description here

Community
  • 1
  • 1
user5139637
  • 775
  • 3
  • 10
  • 29
  • Possible duplicate of [What Uri path to use to connect to Spring WebSocket](http://stackoverflow.com/questions/39301304/what-uri-path-to-use-to-connect-to-spring-websocket) – Artem Bilan Sep 03 '16 at 00:08
  • @ArtemBilan sir, is there a solution to this problem. I asked the duplicate question you mentioned only beacuas no one was answering this. So I asked the other question, rephrasing this question and asking a simple one about what path to use on the client side to connect to the websocket – user5139637 Sep 03 '16 at 00:23

0 Answers0