ITRav4/PlexRedirect

Up and reachable even if plex is not running

smckay79 opened this issue · 8 comments

I think this is not the way it should work. I have mine installed locally on a synology nas, and it reports back to be up and running even if plex is not running. I tried the same setup on my mac, and ultimately with my webserver.

I am getting an error is console, that shows
GET http://xxx.xxx.xxx.xxx:32400/?1455904989253 400 (Bad Request)

the xxx.xxx.xxx.xxx being my local ip address.

Using a website like, http://ping.eu/port-chk/, can actually tell if the port is open or closed.

My Plex Server runs on a different machine (Windows) than my web server (Mac). So the way I set it up was using my public IP address on document.domain and using the remote access port. It shows its down when I exit Plex on my Windows machine. Can you try this please to see if it works?

yeah i did that as well.. webserver is on my synology nas, plex server is on a mac..

function checkServer() { var p = new Ping(); var server = "external.ip.of.mac" //Try to get it automagically, but you can manually specify this var timeout = 2000; //Milliseconds var body = document.getElementsByTagName("body")[0]; p.ping(server+":32400", function(data) { var serverMsg = document.getElementById( "server-status-msg" ); var serverImg = document.getElementById( "server-status-img" ); if (data < 1000){ serverMsg.innerHTML ='Up and reachable'; serverImg.src = "assets/img/ipad-hand-on.png"; body.addClass('online').removeClass("offline"); }else{ serverMsg.innerHTML = 'Down and unreachable'; serverImg.src = "assets/img/ipad-hand-off.png"; } }, timeout); } </script>

So this is what I have setup.. It works, I can see it being up.. however when plex is closed it still reports up. My port on my router is manually set to open if that means anything to this.

This is how I have mine set up: I grabbed my public IP by searching "What's my IP" on Google. Then I used that on 'var server'. I then went and looked at what port Plex was using, 32000 is the internal one and 1xxx7 was the external one. So I set 1xxx7 on 'p.ping'. If I go to http://My.Public.IP:1xxx7/web it took me to my Plex log in screen. If I shut Plex down it says can't access server. This is how my website knows if it's online or not.

    function checkServer() {
        var p = new Ping();
        var server = "Public.IP.Adress" //Try to get it automagically, but you can manually specify this
        var timeout = 2000; //Milliseconds
        var body = document.getElementsByTagName("body")[0];
        p.ping(server+":Plex.Remote.Access.Port", function(data) {
            var serverMsg = document.getElementById( "server-status-msg" );
            var serverImg = document.getElementById( "server-status-img" );
            if (data < 1000){
                serverMsg.innerHTML ='UP and reachable.';
                serverImg.src = "assets/img/ipad-hand-on.png";
                body.addClass('online').removeClass("offline");
            }else{
                serverMsg.innerHTML = 'DOWN and unreachable.';
                serverImg.src = "assets/img/ipad-hand-off.png";
            }
        }, timeout);
    }
</script>

Ahhhh ok... so i think i know the issue.. You are using upnp in the backend plex server, not specifying a port for plex to run on, which would make sense because the port closes when you exit and removes itself from your router (via upnp). I have my port manually configured, and specified as a port forward in my router.

I'm not using UPNP, but I do not use the default 32400 port. I went to Remote Access, Show Advanced and checked Manually Specify Port. I then chose a port and set it up with my router. That's the port I use on the website.

Do you need any more help?

sorry for being delayed, havent had much time.. I did the same thing.. does yours show down when plex is shutdown?

Yes.

The only thing I can think of why it isn't working is because you're on a NAS. Could you try something like installing Plex on your computer, setting up remote access and testing it out there? Only for a test, you wouldn't need to set your HDDs nor anything. Just a blank server.