Skip to content

[Code scan] Pass --bind_all through to the web server #556

Description

@njzjz

This issue was found during a Codex global code scan of the repository.

Baseline commit: e3c5b38

Problem

The CLI exposes --bind_all, but the parsed value is never passed to run(). As a result, dpgui --bind_all still binds only to loopback addresses.

Code references:

dpgui/dpgui/cli.py

Lines 14 to 23 in e3c5b38

argparser.add_argument(
"--bind_all",
action="store_true",
help=(
"Serve on all public interfaces. This will expose your DP-GUI instance "
"to the network on both IPv4 and IPv6 (where available)."
),
)
args = argparser.parse_args()
run(port=args.port)

dpgui/dpgui/web.py

Lines 66 to 72 in e3c5b38

def run(port: int, bind_all: bool = False):
"""Run the web server."""
app = App()
if bind_all:
listen = f"0.0.0.0:{port} [::]:{port}"
else:
listen = f"127.0.0.1:{port} [::1]:{port}"

Relevant snippet:

args = argparser.parse_args()
run(port=args.port)

Impact

Users who explicitly request network binding get the default local-only binding instead, which makes the CLI flag misleading and prevents intended remote access.

Suggested fix

Pass the parsed flag through:

run(port=args.port, bind_all=args.bind_all)

Verification note

A local monkeypatch check with sys.argv=['dpgui', '--bind_all', '--port', '1234'] showed that the current code calls run with only {'port': 1234}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions