2

I have deployed an application on Heroku. When I am trying to connect from other system, it works fine. But when I am trying to access it from my company's system , it get this URL -

o.s.w.s.s.s.DefaultHandshakeHandler      : Handshake failed due to invalid Upgrade header: null

I have gone throw this but dont know how to configure the nginx on Heroku. Also I read somewhere all dynos use a common runtime , hence its not configurable. I am using SockJs from front-end and Spring-Boot in backend. The Request from browser -

GET wss://ketu.herokuapp.com/gs-guide-websocket/873/l0ffiwck/websocket?
token=%22005e6574-9c25-4071-954b-70c8f2c79de2%22 HTTP/1.1
Host: ketu.herokuapp.com
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: https://ketu.herokuapp.com
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,             like Gecko) Chrome/62.0.3202.94 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: JSESSIONID=4CE4921FCD813B9A4DBC7656F6D80286
Sec-WebSocket-Key: tSa9El0a/TL1fVdW586mhw==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

My WebSocketConfig -

@EnableWebSocketMessageBroker
@Configuration
    public class WebSocketConfig implements WebSocketMessageBrokerConfigurer{

    @Override
    public void configureMessageBroker(MessageBrokerRegistry registry) {
        registry.setApplicationDestinationPrefixes("/app");
        registry.setUserDestinationPrefix("/user");
        registry.enableSimpleBroker("/topic","/queue","/user");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/gs-guide-websocket").addInterceptors(new HandshakeInterceptorIml()).withSockJS();
    }
}
Guillaume S
  • 1,462
  • 2
  • 19
  • 31
voucher_wolves
  • 565
  • 10
  • 20
  • 1
    Ask your system administrator at your company, if a proxy could block or closes open web sockets. For some system an constantly open TCP connection is not allowed. That's why the large players decided to not use WebSockets – Simon Franzen Aug 30 '18 at 09:54
  • @SimonFranzen fair enough, I was thinking the same. But worry is , it is failing at handshake which is basically a rest request. Is company's proxy not forwarding any headers. can i infer that ? – voucher_wolves Aug 30 '18 at 09:58

0 Answers0