Reasons to use a proxy
There are several reasons why you should place a proxy between your local domain and the target domain, which are as follows:
Avoid mixing up protocols
If your local domain application is served over SSL with HTTPS and you request a resource that is not served via SSL, the user may get a warning in the browser about mixing secure and non-secure content. Since the request to a proxy can also be made over SSL, there is no mixed content and the user sees no warning.
Some API platforms require proxies or CORS
An API hosted on a domain different from the local domain, a cloud-hosted API, or an Enterprise Service Bus (ESB) may require that cross-domain requests pass through a proxy or be handled by CORS. Apigee Edge, Mulesoft, and Google App Engine are platforms that require a proxy, or CORS, to pass requests. We will review solutions for specific platforms and applications in later chapters.
Getting through a local network firewall
In the same way that you may have to set up...