[DEPRECATED] djismGAMING | plex-ngrok, a way to access PLEX hosted via Starlink or CGNAT


Recommended Posts

DEPRECATED as development for this container has been stagnant since 2020. It has stopped working for me now on the latest Plex updates so far.

 

It's better now to use a proxy like linuxserver/swag or NPM, with a tunnel solution like Cloudflare Tunnels.

Remember to add your public domain URL on Plex's Network settings after turning ON the advanced settings. Be sure to include the port 443 on the URL or Plex clients will still try to use 32400 and fail to connect:

 

iVN6mDNSYe.thumb.jpg.416cccbf8b0d364c87de79633fbed71b.jpg 

 

Original post:

 

djismGAMING_ICON.png.8d6265528a6f5a460c6a7693835868c3.png

 

Application Name: plex-ngrok
Application Site: https://github.com/andriinuts/plex-ngrok-docker
Docker Image Repository: https://hub.docker.com/r/andrijn/plex-ngrok
Github: https://github.com/andriinuts/plex-ngrok-docker

 

Please post any questions/issues relating to this docker you have in this thread.

 

If you need help but are not using unRAID, then please do not post here, instead head to the application's GitHub repository and open an issue there.

 

Edited April 25, 2022 by djismgaming (my 2nd unRAID template ever!)

Edited by djismgaming
added npm and specified tunnel solution
Link to comment
  • djismgaming changed the title to [SUPPORT] djismGAMING | plex-ngrok, a way to access PLEX hosted via Starlink or CGNAT

Hi-- Which plex token are you grabbing?  One seems pretty easy... the other less so.   I'm a little confused by the steps required to get a more-permanent auth token from plex.   My server does work from behind Starlink, but I'm wondering if this would make things more stable as plex keeps thinking it's disconnected (fixed immediately with a manual refresh). 

Link to comment
2 hours ago, tiny-e said:

Hi-- Which plex token are you grabbing?  One seems pretty easy... the other less so.   I'm a little confused by the steps required to get a more-permanent auth token from plex.   My server does work from behind Starlink, but I'm wondering if this would make things more stable as plex keeps thinking it's disconnected (fixed immediately with a manual refresh). 

Yeah!

 

Let's see if I can help you on this ;)
 

  1. login to your plex server
  2. go to a movie you have there (where you see the cast/synopsis of the movie)
  3. push the 3 dots button called "More" when you hover over it
  4. select the option "Get Info"
  5. select the option "View XML" on the window that pops up
  6. get the Plex token from the end of the URL in Chrome/Edge/Safari/Opera like this example
    1. https://someserverinfo.plex.direct:32400/library/metadata/55587?checkFiles=1&includeAllConcerts=1&includeBandwidths=1&includeChapters=1&includeChildren=1&includeConcerts=1&includeExtras=1&includeFields=1&includeGeolocation=1&includeLoudnessRamps=1&includeMarkers=1&includeOnDeck=1&includePopularLeaves=1&includePreferences=1&includeRelated=1&includeRelatedCount=1&includeReviews=1&includeStations=1&X-Plex-Token=Abcd1234abCD1234
  7. Just the values after "Plex-Token="
    1. Abcd1234abCD1234 in this example
  8. That's your Plex token for use in the container

 

Hope this helps!

Edited by djismgaming
Link to comment
2 hours ago, scurrie20 said:

Hi, any idea why this is occurring?

Opera Snapshot_2022-04-29_183320_192.168.1.30.png

I really don't have any. My webUI shows the same (type of display, since the domain itself is different) but the connection works perfectly.

The webUI is optional by the way. Not needed for anything regarding the connection or using it, as far as I know. 

 

Says "online" so it must be working. You can go (in your case) to http://0.tcp.ngrok.io:15538 and the Plex dashboard should load. All good there. Even accessing the link directly does not show any requests on that webUI page.

 

Interestingly, the Status page shows the section "Inspect" as disabled. Maybe that's why. I really don't know how to enable it. Has not been needed to use the connection to Plex remotely or locally.

 

1109797598_Screenshot2022-04-29071500.thumb.png.88c207aa84ec05860b7fa98ab20a27a5.png

 

Enabling it may even use more resources, so I'll not do so anytime soon ;) 

 

Edited by djismgaming
Link to comment
2 minutes ago, [email protected] said:

thank you!!!!  works nicely,

do you what's the limit for a free ngrok account ?

is there any number of connections limit at the same time ?

 

Network Bandwidth ?

I took this from their pricing section. So seems to be a peak of connections, the rate in which those connections are created and 1GB/month per agent.

 

I looked on their TOS but they only say that there are specified limits. I could not find anything in my account dashboard as to which are my limits on the free account and what I'm using of those limits.

 

image.thumb.png.333ae593c83e74c42a18a15b08b3113e.png

Link to comment
8 minutes ago, djismgaming said:

I took this from their pricing section. So seems to be a peak of connections, the rate in which those connections are created and 1GB/month per agent.

 

I looked on their TOS but they only say that there are specified limits. I could not find anything in my account dashboard as to which are my limits on the free account and what I'm using of those limits.

 

image.thumb.png.333ae593c83e74c42a18a15b08b3113e.png

 

limit seems ok for using it with plex. with 1 current stream i have between 7 - 10 open connections, do you think is there gonna be a problem when there's more than 15 streams ?

Link to comment
10 minutes ago, [email protected] said:

 

limit seems ok for using it with plex. with 1 current stream i have between 7 - 10 open connections, do you think is there gonna be a problem when there's more than 15 streams ?

I would really like to know on that regard but there is no info published on ngrok's site that I'm aware of.

If I know something about that at some point, I'll update the post and reply here.

Link to comment
21 hours ago, djismgaming said:

Yeah!

 

Let's see if I can help you on this ;)
 

  1. login to your plex server
  2. go to a movie you have there (where you see the cast/synopsis of the movie)
  3. push the 3 dots button called "More" when you hover over it
  4. select the option "Get Info"
  5. select the option "View XML" on the window that pops up
  6. get the Plex token from the end of the URL in Chrome/Edge/Safari/Opera like this example
    1. https://someserverinfo.plex.direct:32400/library/metadata/55587?checkFiles=1&includeAllConcerts=1&includeBandwidths=1&includeChapters=1&includeChildren=1&includeConcerts=1&includeExtras=1&includeFields=1&includeGeolocation=1&includeLoudnessRamps=1&includeMarkers=1&includeOnDeck=1&includePopularLeaves=1&includePreferences=1&includeRelated=1&includeRelatedCount=1&includeReviews=1&includeStations=1&X-Plex-Token=Abcd1234abCD1234
  7. Just the values after "Plex-Token="
    1. Abcd1234abCD1234 in this example
  8. That's your Plex token for use in the container

 

Hope this helps!

 

 

Cool -- and thanks for the response-- I was just wondering how often one would need to do this -- Plex says that token is temporary..  (not sure if you know)

Link to comment
  • 3 months later...

OK -- I was able to try this out today (also a starlink person).  Could not connect to the plex-web interface unless I changed the NGROK_PROTOCOL variable to HTTP.  Is that normal?  Otherwise the link generated by ngrok wouk be like tcp://blah.blah.io and wouldn't go anywhere.    Please let me know if, for some reason, I shouldn't use for http for this. 

 

Thanks!

image.thumb.png.354f400e1844891f80ddb9679f89fa71.png

Link to comment
On 8/22/2022 at 5:49 PM, tiny-e said:

OK -- I was able to try this out today (also a starlink person).  Could not connect to the plex-web interface unless I changed the NGROK_PROTOCOL variable to HTTP.  Is that normal?  Otherwise the link generated by ngrok wouk be like tcp://blah.blah.io and wouldn't go anywhere.    Please let me know if, for some reason, I shouldn't use for http for this. 

 

Thanks!

image.thumb.png.354f400e1844891f80ddb9679f89fa71.png

Nice catch on your configuration.

 

On mine I tried it and did not work for the remote iOS client I use. Relly don't know the difference this makes on the Plex access apart of changing the protocol to be used with ngrok's service.

  • Upvote 1
Link to comment
On 8/24/2022 at 10:07 AM, colepez said:

Is it possible to repurpose this for another ngrok proxy? I am trying to host a minecraft server any advice?

 

There should be a ngrok container by itself.

I've not yet had a reason to deploy one myself from scratch for another application but Plex.

 

This one is made for Plex since the developer added some python extras to make the URL change inside the Plex server configuration automatically after getting the details from ngrok.

Link to comment
  • 1 month later...

How do I know if it's working?  I can access the server interface via the ngrok link, but it doesn't seem to care about the access token.    Should plex be showing me the custom access URL that the container should be generating? 

Thanks again for any help!

 

 

Link to comment
25 minutes ago, tiny-e said:

How do I know if it's working?  I can access the server interface via the ngrok link, but it doesn't seem to care about the access token.    Should plex be showing me the custom access URL that the container should be generating? 

Thanks again for any help!

 

 

The URL provided by this container is not to be accessed directly by any user as this will change from time to time as far as I know.

This URL is just sent to PLEX for it's servers to be able to find and access the media server itself. This get's sent to your client on Roku (as example) to connect to the server and retrieve media.

 

I did just test it and it works to access the server directly after login in to the plex account.

 

Now the PLEX token is for the container logic (Can be found here: https://github.com/andriinuts/plex-ngrok-docker) to be able to change the URL on your local PLEX media server settings. Specifically the entry: Custom server access URLs. That is because these URLs are dynamic (change from time to time). So this makes it an automated change :D

chrome_X0LyXcW0gP.jpg

 

Also this makes it so you don't have to use the Relay (More info: https://support.plex.tv/articles/216766168-accessing-a-server-through-relay/) as that is bandwidth limited to  2Mbps for Plex Pass subscribers and 1 Mbps for PLEX Free users. (notice I have it disabled at the moment)

Edited by djismgaming
Link to comment
  • djismgaming changed the title to [DEPRECATED] djismGAMING | plex-ngrok, a way to access PLEX hosted via Starlink or CGNAT
  • 1 month later...

Logs show a connection to WebUI on port 4040 not being successful. That is the web interface for the container itself, the one you can use to inspect the connection and the status of it.

 

I never used that portion of the software that much prior to the deprecation of the app on the Community Applications. Maybe some password/is being used for it now?

 

There can be changes that are not accommodated in the version of the template you have for the application. I've deprecated this one as it was not updated for quite some time. Now I see a new version was created just 3 days ago on dockerhub.

 

If someone creates another app using the template, maybe they can see what changed and accommodate the template to those changes in the container.

Link to comment

Looking at the change 3 days ago, not much changed.

The alpine version used in the container and some lightly updated way to get the ngrok URL to pass on to the Plex server.

 

That should, in my opinion, not change how the template behaves.

 

It does say in your logs "connection refused". Check the variables are correctly set and that port 4040 is forwarded to a good port on your host.

 

Variable needed are:

Open TCP port 4040 in the Unraid ngrok docker for the web interface

NGROK_PORT = 32400

NGROK_AUTH = Ngrok Authtoken from their website after you've created an account

PLEX_TOKEN = Plex Authtoken

PLEX_BASE_URL = Plex server url like http://192.168.0.21:32400

NGROK_PROTOCOL = set as TCP

Edited by djismgaming
Link to comment
  • 1 month later...
On 11/29/2022 at 6:58 AM, djismgaming said:

Looking at the change 3 days ago, not much changed.

The alpine version used in the container and some lightly updated way to get the ngrok URL to pass on to the Plex server.

 

That should, in my opinion, not change how the template behaves.

 

It does say in your logs "connection refused". Check the variables are correctly set and that port 4040 is forwarded to a good port on your host.

 

Variable needed are:

Open TCP port 4040 in the Unraid ngrok docker for the web interface

NGROK_PORT = 32400

NGROK_AUTH = Ngrok Authtoken from their website after you've created an account

PLEX_TOKEN = Plex Authtoken

PLEX_BASE_URL = Plex server url like http://192.168.0.21:32400

NGROK_PROTOCOL = set as TCP

My plex-ngrok is now failing in the identical fashion with a "connection refused error". It was working perfectly yesterday and now will not continue to run more than roughly 15 seconds before failing. I'm behind CG-NAT (T-Mobile 5G Internet Gateway) and this is the only way I know of to obtain Plex access outside my home network. Does anyone have any alternative, or a fix for this problem?

 

Thanks!

-Adrian

 

Link to comment

@ParaiseHeights

 

From my comment on the start of the thread, there is a way which I use without any issue so far.

 

As a summary:

 

I use a cloudflare tunnel to swag (reverse proxy) towards my plex container.

 

You could just add the linuxserver.io mod universal-cloudflared to the linuxserver/plex container too. Easier and no need for a reverse proxy. I tested it with a radarr container and works as advertised. I just removed it and setup one for swag so all my apps go through the tunnel without specific configuration of the mod on every single linuxserver-based container. Also, the reverse proxy makes it so it works for every container, not just linuxserver-based ones. ;) 

 

https://github.com/linuxserver/docker-mods/tree/universal-cloudflared

 

Here you can see all mods available to all linuxserver.io containers. The universal option works for any of their containers.

https://mods.linuxserver.io/

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.