title: How does fallback work with socket.io?
body: <p>I'd like to use <code>WebSocket</code> with <code>Java</code>. Problem is, my server is separated from the client by a proxy that cannot be configured. I've been searching for implementations of <code>WebSocket</code> with fallbacks such as <code>long-polling</code>. I've found <code>socket.io</code> but don't know how the fallback works. </p>
  
  <p>Under which case does it replace <code>WebSocket</code> and how?</p>
  
  <p>Are there other libraries like socket.io with fallbacks implementations? I would like to find one in <code>Java</code>, but I only found <code>Jetty</code>.</p>
  
  <p><strong>EDIT:</strong> does the fallback only depend on the browser's compatibility with WebSocket? What if the cause of failure is a proxy badly configured, is socket.io going to detect it as a compatibilty failure and thus switch to long-polling (or another technique)?</p>
  
  <p><strong>Answer:</strong> since v1, socket.io includes <a href="https://github.com/socketio/engine.io" rel="noreferrer">engine.io</a>, which brings the following features:</p>
  
  <p><a href="https://i.stack.imgur.com/JR5vK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JR5vK.png" alt="enter image description here"></a></p>