Skip to content

Commit c117a4c

Browse files
Disable default widget HTTP listener
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent adc687d commit c117a4c

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

‎cli-arguments.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
| `package ignored remove --id id [--manager name] [--version v]` | Removes an ignored-update rule for a package and refreshes the updates view | 2026.1+ |
9494
| `package update-all` | Queues updates for all packages currently shown as upgradable | 2026.1+ |
9595
| `package update-manager --manager name` | Queues updates for all packages handled by the specified manager | 2026.1+ |
96-
| `--background-api-transport {tcp\|named-pipe}` | Selects which local HTTP transport UniGetUI uses for the background API when the app starts | 2026.1+ |
96+
| `--background-api-transport {tcp\|named-pipe}` | Selects which local automation transport UniGetUI uses for the background API when the app starts. On Windows, the default is `named-pipe`, so UniGetUI does not open a localhost TCP listener unless you explicitly choose `tcp`. | 2026.1+ |
9797
| `--background-api-port port` | Overrides the localhost TCP port used by the background API when `--background-api-transport tcp` is active | 2026.1+ |
9898
| `--background-api-pipe-name name` | Overrides the Windows named pipe name used by the background API when `--background-api-transport named-pipe` is active | 2026.1+ |
9999
| `--transport {tcp\|named-pipe}` | Overrides the client-side automation transport used by direct CLI commands such as `status`, `app ...`, `package ...`, and the rest of the verb-based command tree | 2026.1+ |

‎src/UniGetUI.Interface.BackgroundApi/BackgroundApiTransport.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ string NamedPipeName
4444
public string BaseAddressString => BaseAddress.ToString().TrimEnd('/');
4545

4646
public static BackgroundApiTransportOptions Default { get; } = new(
47-
BackgroundApiTransportKind.Tcp,
47+
OperatingSystem.IsWindows()
48+
? BackgroundApiTransportKind.NamedPipe
49+
: BackgroundApiTransportKind.Tcp,
4850
DefaultTcpPort,
4951
DefaultNamedPipeName
5052
);

‎src/UniGetUI.Tests/BackgroundApiTransportTests.cs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ public BackgroundApiTransportTests()
1717
Directory.CreateDirectory(_dataDirectory);
1818
}
1919

20+
[Fact]
21+
public void DefaultTransportUsesNamedPipeOnWindows()
22+
{
23+
BackgroundApiTransportKind expected = OperatingSystem.IsWindows()
24+
? BackgroundApiTransportKind.NamedPipe
25+
: BackgroundApiTransportKind.Tcp;
26+
27+
Assert.Equal(expected, BackgroundApiTransportOptions.Default.TransportKind);
28+
Assert.Equal(BackgroundApiTransportOptions.DefaultTcpPort, BackgroundApiTransportOptions.Default.TcpPort);
29+
Assert.Equal(
30+
BackgroundApiTransportOptions.DefaultNamedPipeName,
31+
BackgroundApiTransportOptions.Default.NamedPipeName
32+
);
33+
}
34+
2035
[Fact]
2136
public void LoadForServerParsesNamedPipeOverrides()
2237
{

0 commit comments

Comments
 (0)