[GH-ISSUE #484] [Feature Request] Allow Wolf API endpoint "/api/v1/sessions/add" to generate a random "client_id" or a "session_id" #294

Open
opened 2026-10-15 12:59:25 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @axolotlite on GitHub (Aug 19, 2026).
Original GitHub issue: https://github.com/games-on-whales/wolf/issues/484

Originally assigned to: @axolotlite on GitHub.

The function endpoint_StreamSessionAdd validates the client_id with moonlight paired devices in wolf, to use it as a id when creating a session to join / leave lobbies.
This means that, for a session to be created, the user must do the pairing process directly with wolf through moonlight.
If we don't specify the client_id during the API call, wolf will assign a default client_id for any session that isn't created from a wolf paired client.

Example API Call:

curl http://localhost/api/v1/sessions/add \
  --unix-socket /etc/wolf/wolf.sock \
  --request POST \
  --header 'Content-Type: application/json' \
  -d '{
    "video_width": 1920,
    "video_height": 1080,
    "video_refresh_rate": 30,
    "audio_channel_count": 2,
    "client_id": "", <------ If omitted, a state specific client_id is created, always the same ID on every api call.
    "client_ip": "10.244.0.1",
    "client_settings": {
      "run_gid": 1000,
      "run_uid": 1000,
      "controllers_override": [
        "XBOX"
      ],
      "mouse_acceleration": 1,
      "v_scroll_acceleration": 1,
      "h_scroll_acceleration": 1,
      "motion_controller_override": "AUTO"
    },
    "aes_key": "17a5ea7cf7079cc33af4a79ad02ed887",
    "aes_iv": "1865730532",
    "rtsp_fake_ip": "10.96.64.123"
  }'

example client_id: 6142509188972423790
This client_id is generated on every session, meaning there are no unique session_ids, they all share the same session_id(client_id) 6142509188972423790.

This causes an issue with Fenrir's moonlight-proxy, which acts as middle man between all users and all wolf instances, any user session created by the moonlight-proxy will have the same client_id/session_id, so if one user disconnects from their session or lobby, this will cause all users on the same wolf instance to disconnect as well.

Requested Changes

Change the generated dummy id to always be randomly generated so we can have unique session_ids for joining/leaving lobbies.

Originally created by @axolotlite on GitHub (Aug 19, 2026). Original GitHub issue: https://github.com/games-on-whales/wolf/issues/484 Originally assigned to: @axolotlite on GitHub. The function [endpoint_StreamSessionAdd](https://github.com/games-on-whales/wolf/blob/7f416ec0f26bb4d95218af806cd1181fe5434598/src/moonlight-server/api/endpoints.cpp#L254-L269) validates the client_id with moonlight paired devices in wolf, to use it as a id when creating a session to join / leave lobbies. This means that, for a session to be created, the user must do the pairing process directly with wolf through moonlight. If we don't specify the client_id during the API call, wolf will assign a default client_id for **any** session that isn't created from a wolf paired client. Example API Call: ```bash curl http://localhost/api/v1/sessions/add \ --unix-socket /etc/wolf/wolf.sock \ --request POST \ --header 'Content-Type: application/json' \ -d '{ "video_width": 1920, "video_height": 1080, "video_refresh_rate": 30, "audio_channel_count": 2, "client_id": "", <------ If omitted, a state specific client_id is created, always the same ID on every api call. "client_ip": "10.244.0.1", "client_settings": { "run_gid": 1000, "run_uid": 1000, "controllers_override": [ "XBOX" ], "mouse_acceleration": 1, "v_scroll_acceleration": 1, "h_scroll_acceleration": 1, "motion_controller_override": "AUTO" }, "aes_key": "17a5ea7cf7079cc33af4a79ad02ed887", "aes_iv": "1865730532", "rtsp_fake_ip": "10.96.64.123" }' ``` example client_id: `6142509188972423790` This client_id is generated on every session, meaning there are no unique session_ids, they all share the same session_id(client_id) 6142509188972423790. This causes an issue with Fenrir's moonlight-proxy, which acts as middle man between all users and all wolf instances, any user session created by the moonlight-proxy will have the same client_id/session_id, so if one user disconnects from their session or lobby, this will cause all users on the same wolf instance to disconnect as well. Requested Changes --- Change the generated [dummy id](https://github.com/games-on-whales/wolf/blob/7f416ec0f26bb4d95218af806cd1181fe5434598/src/moonlight-server/api/endpoints.cpp#L266) to always be randomly generated so we can have unique session_ids for joining/leaving lobbies.
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/wolf#294
No description provided.