Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    604
    Quote Originally Posted by mherger View Post
    > Problem is that request origin is http://localhost:3000, when LMS server
    > is located on a different machine, say 192.168.10.101:9000, this trigger
    > the CORS problem, have you tried in a similar situation?
    >
    > If so, are you shure you did not disable CORS in your browser? This


    You said you were running code in node.js, not in a browser. That's very
    different. In a browser, yes, I would expect it to fail.

    > For me is not urgent, I've solved proxing the request via a spring
    > server running beside (in the same domain of) the node.js server, is a
    > suboptimal solution but it works.


    ?!? why would you need spring if you were running node.js anyway?

    I think you should try to explain what exactly you want to achieve.
    Forget about the components you're running for a moment. Just tell us
    what you want to do.

    --

    Michael
    I have a single page aplication wrote in React running in a browser, backend is node.js, but the main (legacy) logic is in java and this is the point where other web services are consumed, that's why was natural use it as a proxy.

    In the app is included a little controller for players (LMS or others). User could select the player to control from a list, then the controller show the current player status (cover, album, artist and title of current track), prev, play/pause and next buttons (doing what they are expected to to ).

    The goal is fetch the status and send commands to the server associated to the selected player.

    I'd like doing this directly from the front end and it perfectly works for commands, but I can't fetch status data becouse CORS, so I needed a proxy and the spring server was already there... it was easier, but sure I could use Node instead, you're right and, sorry, I was imprecise before saying in Node.js, I was meanining in React...
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

  2. #12
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,376
    I canĺt even... ever thought about simplifying that setup?
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  3. #13
    Senior Member
    Join Date
    Dec 2009
    Location
    Albinea (Bologna Area) Italy
    Posts
    604
    Quote Originally Posted by pippin View Post
    I canĺt even... ever thought about simplifying that setup?
    Sure, in an ideal world I'll convert all the legacy java code to JS, but I'm lazy.

    Or I can stay with Java (as I did for the proxy, indeed), but I'm curious and I liked the idea to try Node.js for new developments. Not sure I'll keep mantain this component or revert the few js components I wrote back in Java.

    But is not so complicated, are just two different server for different services, no overlapping.

    What's your suggestion?
    __________________________________________________ ______________________
    Author of C-3PO plugin, Squeezelite-R2, Falcon Web interface - See www.marcoc1712.it

Posting Permissions

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