Sources used in the talk 'Relaxing the Same Origin Policy'
I gave this talk to the RomaJS community in april 2014. Slides available at https://speakerdeck.com/marcoloche/relaxing-the-same-origin-policy
Configure your hosts
Add following lines to your hosts file
In *NIX system
127.0.0.1 www.site1.local 127.0.0.1 store.site1.local 127.0.0.1 api.site2.local
Open in your browser and go to the index page
Using the console of your favourite broweser take a look what's going on under the hood and pay particular attention to the HTTP Headers of requests and responses.
Same Origin Policy in action
document.domain in action
postMessage a.k.aa Cross-Document messaging