Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to proxify a web socket which do not use STOMP ? #3

Open
afourmi opened this issue May 17, 2017 · 1 comment
Open

How to proxify a web socket which do not use STOMP ? #3

afourmi opened this issue May 17, 2017 · 1 comment

Comments

@afourmi
Copy link

afourmi commented May 17, 2017

the example on README.md shows a configuration related to STOMP over web socket.

How to configure zuul to proxify a pure web socket (without STOMP) ?

For example, the web socket would be exposed as:

@Configuration
@EnableWebSocket
public class WebSocketConfig implements WebSocketConfigurer {

    @Bean
    public ServletServerContainerFactoryBean createWebSocketContainer() {
        ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();
        return container;
    }

    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(new TextWebSocketHandler() {

            @Override
            public void handleTextMessage(WebSocketSession session, TextMessage serializedMessage) throws IOException {
                session.sendMessage(new TextMessage("OK for " + serializedMessage.getPayload()));

            }
        }, "/ws/mywebsocket").setAllowedOrigins("*");
    }

}
@CriPstian
Copy link

Hello,

is this feature possible with the current implementation?
Using STOMP is not a viable solution in my case.
Sorry if this is off topic, but I need to know if I can continue with this, or seek other solutions.

Thank you in advance for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants