Skip to content

Instantly share code, notes, and snippets.

@slominskir
Created December 15, 2022 18:34
Show Gist options
  • Save slominskir/9092d75270420d02d2aef446969a942b to your computer and use it in GitHub Desktop.
Save slominskir/9092d75270420d02d2aef446969a942b to your computer and use it in GitHub Desktop.
Same Origin

Unlike users who can navigate web browsers to any website to make requests, client-side JavaScript programs are limited by the browsers they're running in to only requests to the same host (origin) from which the script came, unless CORS is configured. In practice one of the best ways to deal with this security restriction is often to simply serve dependent apps from the same origin. In Java this is often accomplish with application servers (such as Tomcat and Wildfly) that encourage multiple applications running on the same server (and JVM). Another common strategy to serve from the same origin is to leverage a reverse proxy server such as Apache httpd or HAProxy as this allows separate backend servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment