Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 10
  1. #1
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601

    jsonrpc.js on mysqueezebox.com

    Hi there

    I hate to ask this question - but I've found no answer to this one in the forum:
    Where does jsonrpc.js or its equivalent reside on mysqueezebox.com?
    And on which port is it listening?

    Cheers
    Sebastian
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

  2. #2

  3. #3
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601
    Hello Handy

    I've been trying to get in touch with that same address.
    On port 80 and 9000 - no successs.
    The requests simply time out.

    Username and password are the same as in the www portal login?

    I just post the HTTP command I'm sending out.
    Maybe you'll see something:

    #Connect to: [79.125.21.137:9000]

    POST /jsonrpc.js HTTP/1.1
    Host:79.125.21.137
    Content-type:application/json
    Content-length:72
    Authorization: Basic c2JAc2NpYXRlYy5kZTphdXRvNDQ=

    {"id":1,"method":"slim.request","params":["",["serverstatus","0","10"]]}
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

  4. #4
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601
    On port 80 I am getting the following response:

    [...]
    Location: /user/login?redirect=jsonrpc.js
    Content-Length: 104
    Status: 302
    <html><body><p>This item has moved <a href="/user/login?redirect=jsonrpc.js">here</a>.</p></body></html>


    It's much easier to debug when you have at least confidence in the server address :-)
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

  5. #5
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    18,932
    You'll need to send the session cookie with every request to jsonrpc. I actually don't know whether there is an authentication call on that interface. But you can authenticate against the /user/login url you have been redirected to. Just POST username and password (look at that page's source for details). If you do it in a ajax call, your app won't load all the images anyway.
    Michael

    http://www.herger.net/slim-plugins - AlbumReview, Biography, MusicInfoSCR, Smart Mix

  6. #6
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601
    Hi Michael

    I am doing no ajax. I'm just sending a HTTP POST request to the jsonrpc.js script. The content of the request being my json string.

    I was hoping mysqueezebox.com respsonds in the same way my SB server respsonds. I.e. in json.

    I am still not sure whether this is supposed to be on port 80 0or 9000?
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

  7. #7
    Administrator andyg's Avatar
    Join Date
    Jan 2006
    Location
    Pittsburgh, PA
    Posts
    7,396

    jsonrpc.js on mysqueezebox.com

    Port 80, but you need to be logged in to MySB by sending the proper session cookie.

  8. #8
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601
    So if I understand you allright I need to request the login page
    for example like so:
    http://www.mysqueezebox.com/user/log...ord=mypassword

    And than retrieve the session cookie from the server response.
    That cookie needs to be sent along future requests to jsonrpc.js


    I am treading new ground here -
    please bear with me...

    According to Wikipedia the login-page request should return something like:

    ----
    HTTP/1.1 200 OK
    Content-type: text/html
    Set-Cookie: name=value
    ...
    ----

    And I will than have to build my jsonrpc requests like so:
    -----
    GET /jsonrpc.js HTTP/1.1
    Host: www.mysqueezebox.com
    Cookie: name=value
    Accept: */*
    ----

    Does that make sense?
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

  9. #9
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    18,932

    jsonrpc.js on mysqueezebox.com

    > So if I understand you allright I need to request the login page
    > for example like so:
    > http://www.mysqueezebox.com/user/log...ord=mypassword


    Make it an http POST call, not a GET.

    > And than retrieve the session cookie from the server response.
    > That cookie needs to be sent along future requests to jsonrpc.js


    Correct.

    --

    Michael

  10. #10
    Senior Member Locuth's Avatar
    Join Date
    Apr 2009
    Posts
    601
    Thanks
    Works like a charm.
    Use your PDA/Phone as SqueezeBox remote -- http://sc.sciatec.de

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •