[GH-ISSUE #62] Managing multiple Sunshine backend on a single host #23

Closed
opened 2026-10-15 12:48:01 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @ABeltramo on GitHub (Dec 5, 2021).
Original GitHub issue: https://github.com/games-on-whales/gow/issues/62

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
Originally created by @ABeltramo on GitHub (Dec 5, 2021). Original GitHub issue: https://github.com/games-on-whales/gow/issues/62 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](https://github.com/games-on-whales/gow/blob/77fcc7b7c906142b6589b64c3aa6791b86ffd8a2/images/sunshine/configs/sunshine.conf#L80) 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](https://wiki.archlinux.org/title/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 ```nginx 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 ```
bsakaguchi 2026-10-15 12:48:01 +00:00
Author
Owner

@ABeltramo commented on GitHub (Feb 2, 2023):

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

<!-- gh-comment-id:1414252393 --> @ABeltramo commented on GitHub (Feb 2, 2023): I've ended up building my own alternative, follow the development at https://github.com/games-on-whales/wolf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gow#23
No description provided.