title: How can a web page send a message to the local network
body: <p>Our web application has a button that is supposed to send data to a server on the local network that in turn prints something on a printer.</p>
  
  <p>So far it was easy: The button triggered an AJAX POST request to <code>http://printerserver/print.php</code> with a token, that page connected to the web application to verify the token and get the data to print and then printed.</p>
  
  <p>However, we are now delivering our web application via HTTPs (and I would rather not go back to HTTP for this) and newer versions of Chrome and Firefox don't make the request to the HTTP address anymore, they don't even send the request to check CORS headers.</p>
  
  <p>Now, what is a modern alternative to the cross-protocol XHR? Do Websockets suffer from the same problem? (A Google search did not make clear what is the current state here.) Can I use TCP Sockets already? I would rather not switch to GET requests either, because the action is not idempotent and it might have practical implications with preloading and caching.</p>
  
  <p>I can change the application on the printerserver in any way (so I could replace it with NodeJS or something) but I cannot change the users' browsers (to trust a self-signed certificate for <em>printerserver</em> for example).</p>