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

General discussion about the media server. Feature requests. Hints, tips and tricks.
Locked
User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

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

Post by phibertron » Thu Aug 07, 2014 11:29 pm

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);
    }
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

User avatar
phibertron
Posts:1566
Joined:Sun Jan 30, 2011 5:52 pm
AV Hardware:Hardware
========
WHS - HP Ex495
PS3
XBOX 360
iTouch - Gen 2 and Gen 3
PSP - 3000

Encoders
========
Handbrake
x264
ffmpeg
mencoder

Tagging
======
mp3tag

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

Post by phibertron » Thu Aug 07, 2014 11:32 pm

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;
viewtopic.php?f=2&t=10627
viewtopic.php?f=2&t=9353
viewtopic.php?f=2&t=9408
viewtopic.php?f=2&t=9416
viewtopic.php?f=2&t=9424
viewtopic.php?f=2&t=9364
viewtopic.php?f=2&t=9497

Locked