Page 1 of 1

[BUG] Twonky Server Port number issue with 7.2.x and 7.3.x

Posted: Thu Aug 07, 2014 11:29 pm
by phibertron
Not that one can change the default port from with the web interface
It is possible to change it in the twonkyserver.ini or using an rpc call

The issue is that if the port is less than 4 digits,
for example, try using httpport 90 or 900, they webbrowse portal will not work

# Port of the http server
httpport=90

# Port of the http server
httpport=900

You will NOT be able to go to the Webbrowse or Media Control portal in the web interface
it will basically be blank, the Webconfig portal is fine as far as I can tell

NOTE: this does not affect the DLNA side of things, clients are able to browse and play media via DLNA

I have narrowed the issue down to the HTTPGET function in the browse.js

If you look at the beginning section, there are two assumptions being made, that cause the issue

1. urlin.indexOf(":", 5),
the above assumes that there will be a ":" starting at the 5th postion, no way is that always true

2. url = urlin.substr(i + 5, urlin.length);window.alert(url);
the above is like the first one, which is even worse when one considers this in the url "RBuuid:55076f6e"

NOTE: when the port is 4 digits, it works, they are rare, but there are still scenarios where it wouldn't,

Code: Select all

function httpGet(urlin) {
    var req;
    req = false;
    var i = urlin.indexOf(":", 5),
        url = '';
    if (i < 1) {
        url = urlin;
    }
    else {
        url = urlin.substr(i + 5, urlin.length);
    }

Re: [BUG] Twonky Server Port number issue with 7.2.x and 7.3

Posted: Thu Aug 07, 2014 11:32 pm
by phibertron
In addition to using my Twonky 7.2.x Special Search Version 6 modification

How to enable remote access for Twonky Server 7.2.x
http://twonkyforum.com/viewtopic.php?f=2&t=11402

The quick and dirty way to solve this, until I or twonky make a better solution is to do the following
which just adds "url = urlin;" to the end of it,
which will make it work when one is using 2 or 3 digit port numbers

Code: Select all

function httpGet(urlin) {
    var req;
    req = false;
    var i = urlin.indexOf(":", 5),
        url = '';
    if (i < 1) {
        url = urlin;
    }
    else {
        url = urlin.substr(i + 5, urlin.length);
    }
     url = urlin;