Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture complexity #24

Open
el-gringo opened this issue Nov 29, 2024 · 0 comments
Open

Architecture complexity #24

el-gringo opened this issue Nov 29, 2024 · 0 comments

Comments

@el-gringo
Copy link

el-gringo commented Nov 29, 2024

Hello,

This tool seems very nice, however I am a bit struggling to set it up. So I would like to work on it to make is simpler for my use, and I have some questions before submitting a pull request.

  1. Is there any reason to open different HTTP/WS ports ? That make it difficult to configure with nginx, I have 3 server sections, I have to open 2 more ports... I've updated the code to only have the HTTP port opened then I route the websocket connection to the right WebSocketServer depending on the url:
httpServer.on('upgrade', function upgrade(request, socket, head) {
      const { pathname } = new URL(request.url, 'http://127.0.0.1');

      if (pathname.startsWith('/inspector/')) {
        htmlInspectorSocket.handleUpgrade(request, socket, head, function done(ws) {
          htmlInspectorSocket.emit('connection', ws, request);
        });
      } else if (pathname.startsWith('/device/')) {
        deviceSocket.handleUpgrade(request, socket, head, function done(ws) {
          deviceSocket.emit('connection', ws, request);
        });
      } else {
        socket.destroy();
      }
    });
  1. On the same idea, I can see we can start each server as standalone. Is that a requirement ? You need to run them on different servers ? That would require extra work with the modifications I've made to maintain this behavior.
  2. Working on nodejs with typescript is a bit tedious. I switched to bun for this kind of servers and this removes the need of building. I just run bun --watch rx-paired. However we still neet to build
  3. I also struggled to import client.js in my project in the right way. My bundler does not support assets as URL. So I need to copy the script and update the code to make it run on my project. I might find a way to simplify it in order to not have to import it in my project. It also could be generated by the server.
  4. I also can add a Widevine message logger as I did on a separate project.
    image

Thank you for your nice projects, and sorry for this long post !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant