title: Using an HTTP proxy server to stream IPTV sources
body: <p>I don't know if this is the right place to ask this question but I'm hoping to find directions here.</p>
  
  <p>I have a smart tv and I like to watch tv from my country with the SSIPTV app. I found an android app that streams local channels, so I checked the requests with android studio to find the streaming links. Some of them are free, but some others are served through cloudfront. The problem is that I can't add a header needed for cloudfront to authorize the request.</p>
  
  <p>For example: when I try to make a request without the "User-Agent" header, the response is this:</p>
  
  <pre><code>Status Code: 403 Forbidden
  Connection: keep-alive
  Content-Length: 560
  Content-Type: text/html
  Date: Tue, 01 Jan 2019 20:57:50 GMT
  Server: CloudFront
  Via: 1.1 f7e7b00c5c66a4e43041ba24c378d07a.cloudfront.net (CloudFront)
  X-Amz-Cf-Id: uZQAVTrQzHsQe2vGyHxY1OYfjHCL-Nz7gCTG-koHcgr1A5HG7fGGOg==
  X-Cache: Error from cloudfront
  
  
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;HTML&gt;
      &lt;HEAD&gt;
          &lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"&gt;
          &lt;TITLE&gt;ERROR: The request could not be satisfied&lt;/TITLE&gt;
      &lt;/HEAD&gt;
      &lt;BODY&gt;
          &lt;H1&gt;403 ERROR&lt;/H1&gt;
          &lt;H2&gt;The request could not be satisfied.&lt;/H2&gt;
          &lt;HR noshade size="1px"&gt;
  Request blocked.
  
  
          &lt;BR clear="all"&gt;
          &lt;HR noshade size="1px"&gt;
          &lt;PRE&gt;
  Generated by cloudfront (CloudFront)
  Request ID: TZztsUjltHpEhx54wplzupvLmZwjCRPtAvTcbdJ8DL16b1k9-_XwZw==
  &lt;/PRE&gt;
          &lt;ADDRESS&gt;&lt;/ADDRESS&gt;
      &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>But if I set the "User-Agent" header with the value "iPhone" this is the response:enter code here</p>
  
  <pre><code>Status Code: 200 OK
  Accept-Ranges: bytes
  Access-Control-Allow-Credentials: true
  Access-Control-Allow-Headers: Content-Type, User-Agent, If-Modified-Since, Cache-Control, Range
  Access-Control-Allow-Methods: OPTIONS, GET, POST, HEAD
  Access-Control-Allow-Origin: *
  Access-Control-Expose-Headers: Date, Server, Content-Type, Content-Length
  Cache-Control: max-age=1
  Connection: keep-alive
  Content-Length: 366
  Content-Type: application/vnd.apple.mpegurl
  Date: Tue, 01 Jan 2019 20:51:32 GMT
  Server: WowzaStreamingEngine/4.7.6
  Via: 1.1 880eb84cefca849ee159a7c4d89c31ea.cloudfront.net (CloudFront)
  X-Amz-Cf-Id: pogc8_OBsN2-QeGj_1q8K_vyxrQH-G8a2JmWqSkVt9x57NlbKfDSdQ==
  X-Cache: Hit from cloudfront
  </code></pre>
  
  <p>So, is there a way I could set up a proxy to add the request and then get the content served in my tv app?</p>