Incompatibile SockJS! Main site uses: "1.1.4", the iframe: "1.0.0"

See original GitHub issue

I am constantly getting this issue while trying to use sockjs-client with Waterfox 54.0.0.1 (64-bit) I’ve noticed that there is an iframe.html that gets downloaded in the network tab that says

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <script>
    document.domain = document.domain;
    _sockjs_onload = function(){SockJS.bootstrap_iframe();};
  </script>
  <script src="https://cdn.jsdelivr.net/sockjs/1.0.0/sockjs.min.js"></script>
</head>
<body>
  <h2>Don't panic!</h2>
  <p>This is a SockJS hidden iframe. It's used for cross domain magic.</p>
</body>
</html>

And accordingly I do end up downloading https://cdn.jsdelivr.net/sockjs/1.0.0/sockjs.min.js I’ve noticed however that the included version of sockJS that is bundled is version 1.1.4 and I believe this is what is causing my version mismatch error.

I believe this is an issue that may need to be fixed, although personally I am not quite sure how to fix it. It could also be that I myself am doing something wrong. If you could offer me any insight on this issue I would be extremely grateful!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
jamesjieyecommented, Mar 3, 2018

I had this issue with Spring WebSocket. I put the Spring behind Nginx server. All requests through Nginx. I added the following to port 80.

location / {
    proxy_pass http://localhost:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
}

And in the server log, it showed: Handshake failed due to invalid Upgrade header: null. This is because the upgrade header is not passed from Nginx to Spring.

To fix this, change the setting to the following:

location / {
    proxy_pass http://localhost:8080;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;

    # For WebSocket upgrade header
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
}
2reactions
rstoyanchevcommented, Jul 13, 2017

This could be related to CORS if you’re restricting origins. If you turn up logging on the org.springframework.web.socket.sockjs package you’ll get indication of that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatibile SockJS! Main site uses: "1.1.4", the iframe: "1.0.0".
I think that error (Incompatibile SockJS! Main site uses: "1.1.4", the iframe: "1.0.0".) generate next problems with handshake response. Spring ...
Read more >
Incompatibile Sockjs! Main Site Uses: "1.4.0" The Iframe: "1.0.0"
SockJSclient is a browser JavaScript library that provides Top 5 versions. Incompatibile SockJS! Main site uses: 1.1.4 the iframe: 1.0.0. How to deal...
Read more >
Incompatibile SockJS! Main site uses: "1.0.2", the iframe
Uncaught Error: Incompatibile SockJS! Main site uses: "1.0.2", the iframe: "1.0.0". ; 1. #add this to your nginx config ; 2. ​ ;...
Read more >
“1.5.0“, the iframe: “1.0.0“. at s (VM6 sockjs.min.js:2)版本问题
Incompatibile SockJS ! Main site uses: “1.5.0“, the iframe: “1.0.0“. at s (VM6 sockjs.min.js:2)今天启动服务的时候莫名其妙跳出这个报错, ...
Read more >
sockjs-client - npm
SockJS -client is a browser JavaScript library that provides a WebSocket-like object.. Latest version: 1.6.1, last published: 7 months ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found