# Register client as Plex player

**URL:** <https://forums.plex.tv/t/register-client-as-plex-player/27022>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [January 13, 2013, 12:47pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022 "2013-01-13T12:47:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![newloran2](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@newloran2](https://forums.plex.tv/u/newloran2)\
**Post date:** [January 13, 2013, 12:47pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/1 "2013-01-13T12:47:09Z")

</div>

Hello,  
  
  
  
I’m working on a client to PMS called emplexer [https://github.com/newloran2/emplexer](https://github.com/newloran2/emplexer), this client is a plugin to Dune Media Player.  
  
  
  
I would to support some features like autodetect servers and Plex Client (to navigate via ios/android app and play on emplexer).  
  
  
  
Elan post on this thread [http://forums.plexapp.com/index.php/topic/37867-new-plex-remote/page\_\_view\_\_findpost\_\_p\_\_240861](http://forums.plexapp.com/index.php/topic/37867-new-plex-remote/page __view__ findpost __p__ 240861) the code has able to use GDM to detect servers.  
  
  
  
I incorporated this code on my client and work very well, but i do not know how to register my client as Plex Player.  
  
  
  
If any one tell me how to make this ( only register) i’m really grateful.  
  
  
  
  
  
Thanks to all.

---

<div class="post-metadata">

**Author:** ![hippojay](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hippojay/32/41_2.png) [@hippojay](https://forums.plex.tv/u/hippojay)\
**Post date:** [January 17, 2013, 12:37am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/2 "2013-01-17T00:37:24Z")

</div>

Been looking at this today (when I was trying to work out why Bonjour wasn’t working)  
  
  
  
multicast address: 239.0.0.250 (wasn’t able to get broadcast working)  
  
Multicast port: 32413  
  
  
  
**Message prefix**  
  
HELLO \* HTTP/1.1 - to register a client  
  
BYE \* HTTP/1.1 - to deregister a client (if that is even a word)  
  
  
  
**Message body**  
  
Content-Type: plex/media-player  
  
Resource-Identifier: [some uuid like bd005ed8-fc0f-42de-a72b-5149d6404358]  
  
Name: [name of client]  
  
Port: [port number for requests such as 3000]  
  
Product: [name of client software]  
  
Version: [version of client software]  
  
  
  
So, a registration request would look like this:

```auto

<br />
HELLO * HTTP/1.1<br />
Content-Type: plex/media-player<br />
Resource-Identifier: bd005ed8-fc0f-42de-a72b-5149d6404358<br />
Name: plexbmc-server<br />
Port: 3000<br />
Product: PleXBMC<br />
Version: 3.0.4<br />

```

  
  
A simple bit of python to do this:  

```auto

<br />
import time<br />
import sys<br />
import socket<br />
<br />
mcast_address = '239.0.0.250'<br />
mcast_port = 32413<br />
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)<br />
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 32)<br />
<br />
data=""" * HTTP/1.0<br />
Content-Type: plex/media-player<br />
Resource-Identifier: bd005ed8-fc0f-42de-a72b-5149d6404358<br />
Name: plexbmc-server<br />
Port: 3000<br />
Product: PleXBMC<br />
Version: 3.0.4<br />
<br />
"""<br />
<br />
while 1:<br />
    try:<br />
        sock.sendto('HELLO'+data, (mcast_address, mcast_port))<br />
        time.sleep(5)<br />
    except KeyboardInterrupt:<br />
        sock.sendto('BYE'+data, (mcast_address, mcast_port))<br />
        time.sleep(1)<br />
        break<br />

```

  
  
The only bit I wasn't sure on was refreshing/maintaining. The registration will disappear if the client isn't seen for a period of time (somewhere around 5 seconds) - so I'm not sure whether you need to keep sending HELLO requests, or some other refresh request (or whether the server will poll the client).

---

<div class="post-metadata">

**Author:** ![newloran2](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@newloran2](https://forums.plex.tv/u/newloran2)\
**Post date:** [January 17, 2013, 4:16pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/3 "2013-01-17T16:16:40Z")

</div>

> [@](#):
>
> Been looking at this today (when I was trying to work out why Bonjour wasn't working)  
>   
> multicast address: 239.0.0.250 (wasn't able to get broadcast working)  
> Multicast port: 32413  
>   
> \*\*Message prefix\*\*  
> HELLO \* HTTP/1.1 - to register a client  
> BYE \* HTTP/1.1 - to deregister a client (if that is even a word)  
>   
> \*\*Message body\*\*  
> Content-Type: plex/media-player  
> Resource-Identifier: [some uuid like bd005ed8-fc0f-42de-a72b-5149d6404358]  
> Name: [name of client]  
> Port: [port number for requests such as 3000]  
> Product: [name of client software]  
> Version: [version of client software]  
>   
> So, a registration request would look like this:  
>   
> 
> ```auto
> 
> <br />
> HELLO * HTTP/1.1<br />
> Content-Type: plex/media-player<br />
> Resource-Identifier: bd005ed8-fc0f-42de-a72b-5149d6404358<br />
> Name: plexbmc-server<br />
> Port: 3000<br />
> Product: PleXBMC<br />
> Version: 3.0.4<br />
> 
> ```
> 
>   
>   
> A simple bit of python to do this:  
> 
> ```auto
> 
> <br />
> import time<br />
> import sys<br />
> import socket<br />
> <br />
> mcast_address = '239.0.0.250'<br />
> mcast_port = 32413<br />
> sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)<br />
> sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 32)<br />
> <br />
> data=""" * HTTP/1.0<br />
> Content-Type: plex/media-player<br />
> Resource-Identifier: bd005ed8-fc0f-42de-a72b-5149d6404358<br />
> Name: plexbmc-server<br />
> Port: 3000<br />
> Product: PleXBMC<br />
> Version: 3.0.4<br />
> <br />
> """<br />
> <br />
> while 1:<br />
> try:<br />
> sock.sendto('HELLO'+data, (mcast_address, mcast_port))<br />
> time.sleep(5)<br />
> except KeyboardInterrupt:<br />
> sock.sendto('BYE'+data, (mcast_address, mcast_port))<br />
> time.sleep(1)<br />
> break<br />
> 
> ```
> 
>   
>   
> The only bit I wasn't sure on was refreshing/maintaining. The registration will disappear if the client isn't seen for a period of time (somewhere around 5 seconds) - so I'm not sure whether you need to keep sending HELLO requests, or some other refresh request (or whether the server will poll the client).

  
  
  
  
hippojay,  
  
  
Thank's so much, this code has you posted work's like a charm :), Thank's.

---

<div class="post-metadata">

**Author:** ![hippojay](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/hippojay/32/41_2.png) [@hippojay](https://forums.plex.tv/u/hippojay)\
**Post date:** [February 13, 2013, 3:59pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/4 "2013-02-13T15:59:30Z")

</div>

Just to add that I’ve done some more research and refined the process. The HELLO goes out on port 32413, but you also need to respond to client discovery requests on 32412. I have a python class I’ve put together which does client registration, server discovery, client discover responses and also checks a client to ensure it is still registered.  
  
  
  
It’s part of my PleXBMC Helper app (which translates Plex remote control commands into XBMC ones)  
  
  
  
[https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexGDM.py](https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexGDM.py)

---

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [March 14, 2013, 6:27pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/5 "2013-03-14T18:27:50Z")

</div>

> Just to add that I've done some more research and refined the process. The HELLO goes out on port 32413, but you also need to respond to client discovery requests on 32412. I have a python class I've put together which does client registration, server discovery, client discover responses and also checks a client to ensure it is still registered.  
>   
> It's part of my PleXBMC Helper app (which translates Plex remote control commands into XBMC ones)  
>   
> [https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexGDM.py](https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexGDM.py)

Hi hippojay!

The GitHub Address seems to be out of date - 404ed.

Is the code somewhere else available?

Thanks!

---

<div class="post-metadata">

**Author:** ![newloran2](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@newloran2](https://forums.plex.tv/u/newloran2)\
**Post date:** [March 15, 2013, 11:05am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/6 "2013-03-15T11:05:04Z")

</div>

> Hi hippojay!
> 
> The GitHub Address seems to be out of date - 404ed.
> 
> Is the code somewhere else available?
> 
> Thanks!

New location&nbsp;[https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py.](https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py.)

---

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [March 17, 2013, 10:03am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/7 "2013-03-17T10:03:16Z")

</div>

> New location&nbsp;[https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py.](https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py.)

Aeh... that seems to be the same link (with GDM in small letters) - and still 404'ed for me.&nbsp; :(

---

<div class="post-metadata">

**Author:** ![newloran2](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@newloran2](https://forums.plex.tv/u/newloran2)\
**Post date:** [March 17, 2013, 10:05am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/8 "2013-03-17T10:05:47Z")

</div>

> Aeh... that seems to be the same link (with GDM in small letters) - and still 404'ed for me.&nbsp; :(

try now&nbsp;[https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py](https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py)

---

<div class="post-metadata">

**Author:** ![baa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/baa/32/2026_2.png) [@baa](https://forums.plex.tv/u/baa)\
**Post date:** [March 17, 2013, 11:45am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/9 "2013-03-17T11:45:12Z")

</div>

Great! This link works! Thank you!

---

<div class="post-metadata">

**Author:** ![aleith](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@aleith](https://forums.plex.tv/u/aleith)\
**Post date:** [September 5, 2013, 1:09am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/10 "2013-09-05T01:09:04Z")

</div>

Hey guys, i am brand new to plex development and I too would like to know the correct way to register a client as a player in the media server.  
  
  
Why are we guessing how this works? Is there really no documentation for this? I thought various plex clients were developed by the community – is everyone reverse engineering everything?   
  
  
Is there official documentation anywhere?  
  
  
Thanks,  
  
Andrew

---

<div class="post-metadata">

**Author:** ![kingargyle](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/kingargyle/32/100618_2.png) [@kingargyle](https://forums.plex.tv/u/kingargyle)\
**Post date:** [September 6, 2013, 2:25am UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/11 "2013-09-06T02:25:26Z")

</div>

Your best bet is to look at the code for Plex home theater or the Roku client. They are both open source so you can learn from their code how to do various things from a client perspective.

---

<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, 10:44pm UTC](https://forums.plex.tv/t/register-client-as-plex-player/27022/12 "2019-12-20T22:44:14Z")

</div>

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