title: How to set WebSocket Origin Header from Javascript?
body: <p>I'm trying to use javascript to make a websocket request from a local <code>test.dev</code> page to a server running at ip <code>123.123.123.123</code> on behalf of <code>test.com</code>. The request goes through, but the <code>123.123.123.123</code> server sees the <code>Origin: test.dev</code> header in the websocket request and rejects the connection because it wants to see <code>Origin: test.com</code>.</p>
  
  <p>Here is the javascript code for connecting the socket:</p>
  
  <p><code>ws = new WebSocket("123.123.123.123");
  </code></p>
  
  <p>How can I use javascript to start a websocket connection with a dishonest <code>Origin</code> header of <code>Origin: test.com</code>?</p>
  
  <p>I was hoping something like this would work, but I can't find any such:</p>
  
  <p><code>ws = new WebSocket("123.123.123.123", "test.com");
  </code></p>