libretro / libretro/RetroArch

[Feature Request] Configurable network binding

Open
#19,459 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

When configuring the network control interface, you can set the port and that's about it. Per the docs:

network_cmd_enable = "true"
network_cmd_port = "55355"

I was hoping I would be able to change the bind address so I can secure my deployment a bit, but looking in the code, RetroArch calls socket_init with hardcoded server = NULL. It appears that the rest of the code treats this scenario as binding to 0.0.0.0.

I'd love to be able to set the bind address in the config -- something like:

network_cmd_enable = "true"
network_cmd_listen = "127.0.0.1"
network_cmd_port = "55355"

(Obviously, we'd leave the default bind address to 0.0.0.0 so as not to break existing deployments.)

This would make it so that anyone trying to automate RetroArch could do so without opening their systems to remote unauthenticated ACE (albeit restricted to the emulation core). My particular use case is a kiosk, but I could also see it being useful on cabinets, console-like systems, and less restrictive kiosks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in command.c at the network control interface setup where socket_init is called with server set to NULL, then trace how network_cmd_enable and network_cmd_port are read from configuration. Add support for a network_cmd_listen setting while preserving the existing default bind address, and verify that the interface still starts with the documented settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking, security
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.