title: Symfony to "proxy" a webservice?
body: <p>I'm struggling a bit with the following: I have a symfony web-application which calls a webservice (hosted on another server). The webservice returns a JSON object with calendar data, and in my symfony controller this data is saved in an array. For the visualisation of the calendar towards the users I use <a href="https://fullcalendar.io/" rel="nofollow noreferrer">https://fullcalendar.io/</a>, which needs to be &quot;feeded&quot; the data from the webservice.
  This works fine when the browser of the users connects directly towards the webservice to &quot;read&quot; the JSON stream with pretty standard Javascript, but the aim is that there will be no direct connections to the werbservice, only to the symfony webserver.</p>
  <p>So I want the connection to go as followed:</p>
  <pre><code>User-browser -&gt; Symfony webserver -&gt;(JSON) -&gt; Webservices -&gt; SQL server 
  </code></pre>
  <p>But currently the User-browser has also still &quot;one leg to the webservices&quot; to consult the JSON feed with calendar items.</p>
  <p>I think I'm missing something which is in plain sight, but how can I avoid that the user calls directly the Webservice?</p>
  <ul>
  <li>I could make a (similar) webservice that gives a JSON feed on the
  symfony apllication (and so actually make my webserver act in a
  certain way as a proxy for the webservice server).</li>
  <li>I could try to
  work with a global variable
  (<a href="https://fullcalendar.io/docs/events-array" rel="nofollow noreferrer">https://fullcalendar.io/docs/events-array</a>) that contains the array
  with the calendar items (could become messy when multiple users work
  simultaneously on it).</li>
  </ul>
  <p>But these don't seem correct approaches to me...</p>
  <p>Am I missing something obvious?</p>