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

Fix loopback connections in IE10/IE11/Edge #6

Closed
tresf opened this issue Mar 15, 2016 · 5 comments
Closed

Fix loopback connections in IE10/IE11/Edge #6

tresf opened this issue Mar 15, 2016 · 5 comments
Labels

Comments

@tresf
Copy link
Contributor

tresf commented Mar 15, 2016

Update: Domain networks have been fixed in 2.0.2 and higher via DNS workaround per b30beb7

Steps:

1. Run a custom batch script on each client:
https://gist.github.com/tresf/a57d6f342ca3886cb364fe153e34943f

Custom script no longer needed, via b30beb7

  1. On the server, modify the JavaScript logic with the following fallback logic:

    qz.websocket.connect().then(function() {
      // We'll never get here in IE11/Edge on domain environment
    }).catch(function(ignore) {
      // IE11/Edge workaround
      console.warn("Could not connect to localhost, attempting localhost.qz.io instead.");
      // Note, to connect to locahost.qz.io using SSL/HTTPS, you NEED to re-run windows-keygen.js, see issue #6
      return qz.websocket.connect({ host: "localhost.qz.io" });
    }).catch(function(err) {
      // Apparently we couldn't use workaround 
      console.error(err);
    });

Currently, we use a brute-force method in IE to allow WebSocket communication by telling the computer to stop Automatically detect intranet network

image

This is a stop-gap which has adverse side-effects on a corporate LAN as it prompts for login credentials when accessing web resources.

Migrated from qzind/qz-print#67

@tresf
Copy link
Contributor Author

tresf commented Apr 15, 2016

This issues seems to have vanished in recent testing (perhaps an IE11 update patches this?)

  • Tested on Windows 10 x64 and it seems to work regardless of these settings.
  • Tested on Windows 7 x32 and it seems to work regardless of these settings.

@tresf
Copy link
Contributor Author

tresf commented Apr 20, 2016

Internet Options, Security, Local intranet, Sites button, Automatically detect intranet network

  • Unchecked by default on a new user profile in Windows 7
  • https://demo.qz.io blocked by default on a new user profile in Windows 7
  • Unchecking Include all local (intranet) sites not listed in other zones fixes https://demo.qz.io

However...

So the highest compat? Always check Automatically detect intranet network

e.g.

image

... or

image

Note, http://localhost has not yet been tested.

@tresf tresf closed this as completed in a77a351 Apr 20, 2016
@tresf
Copy link
Contributor Author

tresf commented Apr 21, 2016

Although a77a351 fixes connections for WORKGROUP computers, it does little to help with the domain environments due to the default Intranet Zone behavior on domain/corporate networks.

This puts IE and Edge in a bad state as the environments which tend to need IE support the most (controlled, domain style environments) suffer the worst IE support.

I've found an interesting work-around and depending on how the other OS's respond, it may be a good idea to leverage to deal with some potential future Chrome changes. The idea is pretty simple:

  • Use a FQDN instead of localhost and point it back to localhost (or 127.0.0.1, ::1, etc). qz.websocket.connect({host: '<FQDN>...'});
  • Change the just-in-time certificate to be marked for the FQDN rather than localhost.
  • Force a manual DNS mapping on each platform to alias the FQDN properly (e.g. C:\Windows\System32\drivers\etc\hosts ...)

But this has serious scalibility problems... First, if Chrome does lock down localhost connections, this will only fix communication for domains that appear to be same-origin. e.g. Client websites may eventually suffer non-same-origin security warnings. Second it adds yet another hack to every OS. Last, writing fake DNS entries is frowned upon and can be observed as malware activity, at least on Windows.

So what's the lesser of all evils? Keep new functionality, restore old, or more hacks? @klabarge suggested making this configurable in the GUI, which is probably better than clobbering internet settings. Perhaps that's as far as we can get with this.

@tresf tresf reopened this Apr 21, 2016
@tresf tresf closed this as completed in 7f9d02f Apr 22, 2016
@tresf tresf changed the title Fix loopback connections in IE11 Fix loopback connections in IE10/IE11/Edge Apr 22, 2016
@tresf
Copy link
Contributor Author

tresf commented Apr 22, 2016

Added documentation via https://github.com/qzind/tray/wiki/FAQ#web-browsers

tresf added a commit that referenced this issue Jun 14, 2016
Closes #6
Improves readability of bitwise logic block
tresf added a commit that referenced this issue Jun 14, 2016
Closes #6
Revert logic for saner defaults on domain networks.
akberenz pushed a commit that referenced this issue Jun 29, 2016
Closes #6
Improves readability of bitwise logic block
akberenz pushed a commit that referenced this issue Jun 29, 2016
Closes #6
Revert logic for saner defaults on domain networks.
@tresf
Copy link
Contributor Author

tresf commented Aug 10, 2016

Per popular demand, we've added localhost.qz.io as a public address which will point back to 127.0.0.1.

This means qz.websocket.connect(...) can be modified to use the "Internet Zone" address to circumvent this "Intranet Zone" issue, however it will require a batch file be run on each workstation.

This has been documented here: #6 (comment)

tresf added a commit that referenced this issue Aug 12, 2016
Fixes websocket connections in IE/Edge per #6
tresf added a commit to Vzor-/tray that referenced this issue Oct 6, 2023
Caching for CUPS status performance

---------

Co-authored-by: Vzor- <Kyle@Berezin.com>
tresf added a commit that referenced this issue Oct 12, 2023
Caching for CUPS status performance (#6)

---------
Co-authored-by: Vzor- <Kyle@Berezin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant