Remote access through ngrok

I run a plex server on my computer in my dorm room. It is behind a my router which in turn is behind a college router. I have to use http/https proxy with authentication to connect to the internet. I wanted to access my plex server remotely. Instead of hassling with port forwarding (as i do not have access to the college router) I tried to use ngrok to forward my plex port (32400). I have configured ngrok to use my proxy credentials and have successfully used it to access my nas over the internet. I ran the following command on ngrok:
ngrok http 32400
It was connected successfully and gave me a domain name (xxxxxxxxxxxx.ngrok.io)
I entered this in my browser of my laptop connected directly to the internet using a 4g dongle. The browser was in fact able to connect, plex even asked me to login.
After loging it just shows looking for servers…
I have enabled remote access on 32400 ( although I dont think this is necessary as ngrok runs as a local host - please tell me if I am wrong)
The only reason I can think of is that as I am behind a http proxy the plex server is not able to connect to internet (I have been using it on local only). So, my remote client even though it is able to connect on the port, it is not able to access it as the sever is not on the internet (I dont know how plex searches for servers, this is what I think is happening). Please help me get this working.

Update ngrok works with plex sort of…
You can now use ngrok with plex as long as you are on a pc web browser (it doesn’t work with the plex apps yet).

in ngrok type

ngrok tcp 32400

you should now get a url:

tcp://0.tcp.ngrok.io:xxxxx

xxxx is the port number given by the ngrok app

now you can type in your web browser

https://0.tcp.ngrok.io:xxxxx

at this point, your browser will have a panic attack due to invalid certificate ignore the warning and continue to sign in (the warning is a result of the certificate being generated locally from your plex server). And that’s it plex should stream and even acknowledges the server as a remote connection (no indirect).

if the above steps fail to try to ping 0.tcp.ngrok.io and use the IP instead of the URL.

note restarting plex or closing ngrok will change the url port unless you are on a paid plan

Another update
Update this method works with plex apps just add the ngrok url to custom access urls on plex and it should work. This will also allow you to access ngrok using the usually plex.tv domain.

New edit:
I stumbled upon a python script and forked it:

This lovely script will obtain a ngrok url and port convert the domain of ngrok url to ip, assemble a new url with ngrok ip and port (ex: https://18.216.53.253:[yourport]) and publish the domain to plex.tv. The ip conversion had to be added to the script as custom url domains must start with plex.yourdomain.com (or org, etc). This script can be scheduled via a cron job or task scheduler on windows for nearly autonomous experience. Hope this helps :slight_smile:

Another edit:
So I’m wrong about the plex.yourdomain.com you can have what ever domain you please. The problem with using 0.tcp.ngrok.io is the plex direct link is set to your public ip and not ngrok’s ip. This causes an ssl issues.

Hi,

Sorry for my english, :wink:

I follow your guide for plex and ngrok, for me it work fine on browser, on plex android apps but not in plex ios apps, any idea ? PS: ( i have plex pass, ngrok pro).

It works on ios for me. Try using these ip’s instead of http://0.tcp.ngrok.io/ (they are various ngrok servers)
https://18.216.53.253:[your port]
https://52.15.62.13:[your port]
https://52.15.72.79:[your port]

I’d prolly recomend u daisy chain the ip’s for redundency as if one of these servers goes down plex will jump to the other two. I’m also on ngrok free but it should be the same.

Also a side question. What is the max resolution are you able to get through ngrok? Mine maxes out at 4mbs. Wondering if ngrok pro gives increased bandwith…

Hi, thx for your reply,

My server is in europe i think its not the same ip as you (1.tcp.eu.ngrok.io) How do you do for obtain the list of ngrok ip servers ?

I can play my video in original résolution (1080p) and if i convert it work in 1080p 8mpbs on my android

If it work a day with my ipad pro i will test it for you :wink: on it

Its work !!!
For it, i do all you do and
Remove “s” from https in custom server access urls : http://1.tcp.eu.ngrok.io:xxxxx
And i disabled secure connection on the same page.

I confirm you i can play my movie (720p to 1080p) in original quality with no conversion :wink: movie in 4k need conversion to 1080p 20 mbps

Interesting I gues the premium is giving a higher bandwith capaciy. I’ve tried to occasionally download files and it maxes at 628kbs while downloading. Yet some how this works with plex 4mbs streams. Glad the guide helped and thanks for the info

Thx to you

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