# HTTP headers when opening a stream

**URL:** <https://forums.plex.tv/t/http-headers-when-opening-a-stream/142543>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [April 16, 2016, 9:37pm UTC](https://forums.plex.tv/t/http-headers-when-opening-a-stream/142543 "2016-04-16T21:37:39Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![coryo123](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@coryo123](https://forums.plex.tv/u/coryo123)\
**Post date:** [April 16, 2016, 11:37pm UTC](https://forums.plex.tv/t/http-headers-when-opening-a-stream/142543/2 "2016-04-16T23:37:53Z")

</div>

If the clients don’t respect the http\_headers parameter you could try having the server act as a proxy for the playlist.

something like this might work in a url service:

```auto
def MediaObjectsForURL(url):
    return [
        MediaObject(
            protocol='hls',
            container='mpegts',
            video_codec=VideoCodec.H264,
            audio_codec=AudioCodec.AAC,
            audio_channels=2,
            optimized_for_streaming=True,
            parts=[PartObject(key=Callback(playlist, url=url, ext='m3u8'))]
        )
    ]

def playlist(url):
    return HTTP.Request(url, headers={'X-Headers': '...'}).content

```

---

_[View the full topic](https://forums.plex.tv/t/http-headers-when-opening-a-stream/142543)._
