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

Managing multiple Sunshine backend on a single host #62

Closed
ABeltramo opened this issue Dec 5, 2021 · 1 comment
Closed

Managing multiple Sunshine backend on a single host #62

ABeltramo opened this issue Dec 5, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ABeltramo
Copy link
Member

ABeltramo commented Dec 5, 2021

This is something that has been requested over and over again:

Can I let different users share a single machine for multiple gaming sessions at the same time?

Bare in mind that Moonlight does support already multiple players sharing one gaming backend (Sunshine) for Co-Op or similar games. In order to use that change the channels param in the Sunshine conf file.

There are multiple issues that needs to be solved in order to achieve this:

  • Right now Moonlight doesn't support connecting to different ports. I tried using nginx for this so that we can reverse proxy in front but since it's not HTTP but on a lower stack: TCP/UDP there's no easy way to dispatch based on the domain name (see the section below)
    • One way around it for now is to manually re-compile the client with a different set of hardcoded ports.
  • Having separate X11 display per remote player, this probably can be achieved using Xorg multiseat but needs testing (Thanks to @diadatp for pointing it out!)
  • Separate uinput devices so that keyboard/mouse/controller don't clash with each other.

Nginx reverse proxy Sunshine

I was able to passthru from one host to one other host so that Moonlight was pointing to x.x.x.x and Nginx was redirecting the connection to y.y.y.y
This works fine, but I wasn't able to dispatch based on the domain name or even just to load balance between 2 or more backends).

[1] Here's my nginx.conf file

events {}

stream {

   server {
        listen 47998 udp;
        listen 47999 udp;
        listen 48000 udp;
        listen 48002 udp;
        listen 48010 udp;

        listen 47984;
        listen 47989;
        listen 48010;

        # This can possibly be bound to an upstream so that you can load balance between backends
        # I couldn't make it work with the $server_port variable
        # But probably some wizard can
        proxy_pass y.y.y.y:$server_port;
    }

And I started it using

sudo docker run --name nginx --rm -v ~/nginx-gow.conf:/etc/nginx/nginx.conf:ro -p 47998-48010:47998-48010/udp -p 47984-48010:47984-48010/tcp nginx:1.21-alpine
@ABeltramo ABeltramo added enhancement New feature or request help wanted Extra attention is needed labels Dec 5, 2021
@ABeltramo
Copy link
Member Author

I've ended up building my own alternative, follow the development at https://github.com/games-on-whales/wolf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant