title: Serving Dynamic Data to a WebPage avoiding Cross Domain Warnings and Firewall blocks
body: <p>I am designing a website that uses JavaScript Ajax XHR calls to retrieve dynamic data.  </p>
  
  <p>I have two C++ based applications that serve data on their own ports, and I have control of the ports that they use.</p>
  
  <p>Dynamic Data is requested with HTTP 1.1 requests and data is returned with an HTTP 1.1 header, and I have control of the header data.  Effectively, I have a custom HTTP server embedded in my dynamic data applications, so I have full control of both ends of the conversation.</p>
  
  <p>If I choose two arbitrary ports to serve the dynamic data on, will the browser-based user have to open those ports on their firewall to allow the request from my web page?</p>
  
  <p>For example, the web page would be served as www.mydomain.com/default.aspx, and within it, it would have Ajax XHR calls to make connections to www.mydomain.com:8080 and www.mydomain.com:8081 (or whatever port numbers are chosen).</p>
  
  <p>Am I going to be blocked by the same origin policy?  </p>
  
  <p>Could I get away with using ports that are often open on firewalls, but not actively being served on my server?</p>
  
  <p>What is the best way to work around this so that the user does not have to make firewall changes and does not get a cross domain warning?  I'm hoping not to use iFrames if possible.</p>
  
  <p>This topic may have been asked before, I have searched thoroughly but have not found anything that matches.</p>