# RTMP and cookies etc

**URL:** <https://forums.plex.tv/t/rtmp-and-cookies-etc/38047>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [July 8, 2013, 7:48pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047 "2013-07-08T19:48:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [July 8, 2013, 7:48pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/1 "2013-07-08T19:48:44Z")

</div>

I've stumbled upon a problem regarding RTMP and the swf\_url. How do I pass for example cookies to use to the RTMPVideoURL function?

&nbsp;

Currently I see a '403 Forbidden' when the swf\_url is requested. I don't know if it is a cookie issue(or Referrer) etc, but I have a log where it succeeds(logged from the corresponding webpage)

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![mikedm139](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mikedm139/32/96909_2.png) [@mikedm139](https://forums.plex.tv/u/mikedm139)\
**Post date:** [July 8, 2013, 11:01pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/2 "2013-07-08T23:01:59Z")

</div>

If you return a RTMPVideoURL() from your PlayVideo() using an IndirectResponse(), you can add in cookies which will be used by the client (or transcoder) when making the necessary playback http requests. I couldn't find an example where that's been done with RTMP but I did find one for HLS in the [NBC URL Service](https://github.com/plexinc-plugins/Services.bundle/blob/c0196ac72795922951b0b716dee0bafa21b5a382/Contents/Service%20Sets/com.plexapp.plugins.nbc/URL/NBC/ServiceCode.pys#L112). Obviously HLS and RTMP are very different but the way the cookies are handled via the framework should be similar enough for illustration purposes :)

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [July 9, 2013, 8:16am UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/3 "2013-07-09T08:16:11Z")

</div>

> If you return a RTMPVideoURL() from your PlayVideo() using an IndirectResponse(), you can add in cookies which will be used by the client (or transcoder) when making the necessary playback http requests. I couldn't find an example where that's been done with RTMP but I did find one for HLS in the [NBC URL Service](https://github.com/plexinc-plugins/Services.bundle/blob/c0196ac72795922951b0b716dee0bafa21b5a382/Contents/Service%20Sets/com.plexapp.plugins.nbc/URL/NBC/ServiceCode.pys#L112). Obviously HLS and RTMP are very different but the way the cookies are handled via the framework should be similar enough for illustration purposes :)

Thanks!

I will try that

---

<div class="post-metadata">

**Author:** ![meo](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/meo/32/4534_2.png) [@meo](https://forums.plex.tv/u/meo)\
**Post date:** [July 9, 2013, 6:20pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/4 "2013-07-09T18:20:20Z")

</div>

It worked! But sadly this did not solve my problem, seems to be something other than cookies to get rid of that 403 ...

However I found another way around this problem and didn't have to use RTMP, but it is still good to know how this works if a another situation demands it.&nbsp;Thanks for your fast response!

---

<div class="post-metadata">

**Author:** ![mikedm139](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mikedm139/32/96909_2.png) [@mikedm139](https://forums.plex.tv/u/mikedm139)\
**Post date:** [July 9, 2013, 6:51pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/5 "2013-07-09T18:51:40Z")

</div>

Glad to help out (fwiw) :)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 11:41pm UTC](https://forums.plex.tv/t/rtmp-and-cookies-etc/38047/6 "2019-12-20T23:41:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
