title: Access-Control-Allow-Origin and Servlet as proxy
body: <p>I have a servlet that acts as a proxy.
  it takes external resources and serves a client (browser) that shows the inside of an iframe.</p>
  
  <p>how can I overcome the problem of Access-Control-Allow-Origin?</p>
  
  <p>In fact, it happens that some external resource open other connections to the original server, but these are denied due to this problem.</p>
  
  <p>The resources are loaded from another server that I cannot control, but I can make changes on the resource once it has been stored in my servlet.</p>
  
  <p>I tried inserting:</p>
  
  <pre><code>&lt;script&gt; document.domain=" +ORIGINAL_DOMAIN+ "&lt;/ script&gt;
  </code></pre>
  
  <p>but I get a</p>
  
  <pre><code>Uncaught Error: SECURITY_ERR: DOM Exception 18
  </code></pre>