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

stomp proxy #39

Open
alleywind opened this issue May 28, 2014 · 4 comments
Open

stomp proxy #39

alleywind opened this issue May 28, 2014 · 4 comments

Comments

@alleywind
Copy link

Is there any application like httpd or nginx which could proxy stomp protocol?

@th3sly
Copy link

th3sly commented May 28, 2014

you can configure HAproxy to work with websockets http://blog.silverbucket.net/post/31927044856/3-ways-to-configure-haproxy-for-websockets

@Bessonov
Copy link

Bessonov commented Jan 2, 2015

Working config snippet for nginx:

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

[...]

        location /bus {
            proxy_read_timeout 999999999;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_pass http://127.0.0.1:8080;
       }

@idelpivnitskiy
Copy link

I used nginx configuration which is presented above, but it didn't work for me in Google Chrome and worked in Firefox only through xhr (for websocket it returned 403). To solve this issue I've added setAllowedOrigins("http://mydomain") to my registered endpoint:

@Configuration
@EnableScheduling
@ComponentScan("org.springframework.samples")
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/portfolio").setAllowedOrigins("http://mydomain").withSockJS();
    }
    ...
}

See

@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/portfolio").withSockJS();
}

Hope, this will help to somebody :)

@ianaz
Copy link

ianaz commented Oct 15, 2015

Hi @idelpivnitskiy , this definitely helped me, thank you :)

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

5 participants