2

I have a spring boot application with websocket setup via sockJs.

public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
        stompEndpointRegistry.addEndpoint("/gs-guide-websocket").setAllowedOrigins("*")
                .withSockJS();
    }

I am deploying it in openshift which has a restriction to use port 8000 for websocket. Is it possible to configure spring to use port 8000 for ws:// and keep http:// to port 80?

BiJ
  • 1,639
  • 5
  • 24
  • 55
  • Read this similar question : https://stackoverflow.com/q/25708617/1793718 – Lucky Jun 13 '17 at 07:27
  • 1
    Possible duplicate of [Spring 4 WebSocket configure port](https://stackoverflow.com/questions/25708617/spring-4-websocket-configure-port) – P.J.Meisch Jun 13 '17 at 07:42

1 Answers1

0

What OpenShift version are you using?

If you are using OpenShift 3, then a separate port is not used for WebSockets. Any HTTP traffic, whether WebSockets or not, would be exposed outside of the cluster on port 80, or port 443 for secure connections.

Within the container itself, it is typical in OpenShift 3 to use port 8080. Again this is for any HTTP traffic, including WebSockets.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134