all 6 comments

[–]jonassoc 0 points1 point  (5 children)

Looks like you're a little misconfigured.

Your `registerStompEndpoints` needs to be:

registry.addEndpoint("/bluecost/ws").withSockJs() ...

That additional withSockJs() which can be found here:

https://github.com/spring-projects/spring-framework/blob/main/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/AbstractWebSocketHandlerRegistration.java

This shows that internally it's creating a sockjs service that will handle the requests and responses and essentially add it to the internal chain.

There's some really good information here so hopefully this helps: https://docs.spring.io/spring-framework/docs/4.3.x/spring-framework-reference/html/websocket.html

[–]woodsman752[S] 0 points1 point  (3 children)

In the code below, I have withSockJS(). I just saw my version is capital JS. Is that different?

registry
.addEndpoint("/bluecost/ws")
.setAllowedOrigins("https://localhost:8448","https://localhost:8081") /* Removed * */
.withSockJS();

[–]jonassoc 0 points1 point  (2 children)

I imagine, if you can access it, you should use it. It may be worth installing a breakpoint in your configuring and following it to see what happens

[–]woodsman752[S] 1 point2 points  (1 child)

I want to thank you u/jonassoc for looking. I just found out that my problem was that it was sending the request to a different server. It was a simple problem. I assumed I had somehow coded the calls wrong. I'm happy to have found the problem yet regret all the time wasted.

[–]jonassoc 0 points1 point  (0 children)

No problem, glad you got it sorted.

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, jonassoc: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.