PeakSWC.RemoteWebViewService.Lib
11.0.0.1
dotnet add package PeakSWC.RemoteWebViewService.Lib --version 11.0.0.1
NuGet\Install-Package PeakSWC.RemoteWebViewService.Lib -Version 11.0.0.1
<PackageReference Include="PeakSWC.RemoteWebViewService.Lib" Version="11.0.0.1" />
<PackageVersion Include="PeakSWC.RemoteWebViewService.Lib" Version="11.0.0.1" />
<PackageReference Include="PeakSWC.RemoteWebViewService.Lib" />
paket add PeakSWC.RemoteWebViewService.Lib --version 11.0.0.1
#r "nuget: PeakSWC.RemoteWebViewService.Lib, 11.0.0.1"
#:package PeakSWC.RemoteWebViewService.Lib@11.0.0.1
#addin nuget:?package=PeakSWC.RemoteWebViewService.Lib&version=11.0.0.1
#tool nuget:?package=PeakSWC.RemoteWebViewService.Lib&version=11.0.0.1
PeakSWC.RemoteWebViewService.Lib
The RemoteWebViewService as a library. The same code that runs as RemoteWebViewService.exe (and in the
Railway container) can be hosted inside your own process, for example a WPF or WinForms app that shows its
RemoteBlazorWebView UI in a local browser or a WebView2 iframe without a separate server process.
Embedded (in-process)
using PeakSWC.RemoteWebView;
// Loopback, plain HTTP, free ports. Returns once Kestrel is listening; does not block.
await using var server = await RemoteWebViewServer.StartAsync(new RemoteWebViewServerOptions
{
MaxClients = 1,
FrameAncestors = ["'self'", "https://host.example"], // optional
ConfigureLogging = lb => lb.AddDebug(), // optional; default is silent
});
blazorWebView.ServerUri = server.BaseUri; // browsers: http://127.0.0.1:<port>/
blazorWebView.GrpcBaseUri = server.GrpcUri; // native gRPC client: http://127.0.0.1:<grpcPort>/
// The page for a client is new Uri(server.BaseUri, $"app/{blazorWebView.Id}")
await server.StopAsync(); // or dispose
Port = 0(the default) binds a free port; read the real one fromserver.Port/server.BaseUri.- Plain HTTP is allowed only on a loopback address, so no development certificate is needed. Without TLS
there is no ALPN, so browsers (HTTP/1.1, gRPC-Web) and the native gRPC client (HTTP/2) get separate ports.
Set
UseHttps = true(dev certificate) orCertificateto serve both on one HTTPS port. - The embedded host does not change the current directory or thread pool, does not read the host app's
appsettings.jsonor environment variables, and does not hook Ctrl+C or process exit. MaxClientslimits concurrent RemoteWebView clients (a newCreateWebViewgets 503 /Unavailable); browser requests for connected clients are never blocked. WithMaxClients = 1the client-list and file-watcher services are not mapped. The agent hub (doc/Agents.md) is never mapped when embedded.FrameAncestorsaddsContent-Security-Policy: frame-ancestors ...to HTML responses and rejects cross-origin script calls whoseOriginis not listed. Same-origin calls are always allowed.
Experimental: agent registry
The agent registry (AgentHub / AgentAdmin, see doc/Agents.md in the repository) is experimental and may change or be
removed in any release. Its public types are marked [Experimental("RWV001")], so using them produces compiler diagnostic
RWV001; add <NoWarn>$(NoWarn);RWV001</NoWarn> to opt in. The rest of this package is not affected.
Standalone
RemoteWebViewServer.Run(args); // what RemoteWebViewService.exe does
RemoteWebViewServer.Run(5001, maxNumClients: 1, frameAncestors: ["'self'"]); // blocking, HTTPS on loopback
Two-way voice for WPF sessions
Set BlazorWebView.EnableVoice = true before setting HostPage. Use HTTPS for the browser and host connections, and deploy a relay built with voice support. Open the controller through /app/{id} to get its one-time voice grant. In deployments without sign-in, treat the controller link as a credential. Mirror pages have no voice controls or grant.
The controller can request a call. The person at the PC accepts or declines in a separate local WebView2 window. Both sides can mute or hang up, and closing either endpoint ends the call. Voice uses the default input and output devices. The relay forwards call setup messages and WebRTC carries audio directly or through TURN.
Configure Voice__StunUrl for STUN and Voice__TurnUrl with Voice__TurnSecret for a TURN server that supports shared-secret credentials. For example, use turns:turn.example.com:443?transport=tcp for a TURN TLS listener on port 443. Keep the TURN secret on the relay. Configure the HTTPS proxy to forward WebSocket upgrades and preserve the public Host header on /voice/{id}/signal.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Google.Protobuf (>= 3.36.2)
- Grpc.AspNetCore.Server (>= 2.85.0)
- Grpc.AspNetCore.Web (>= 2.85.0)
- Microsoft.AspNetCore.Components.WebAssembly.Server (>= 11.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Based on maui 11.0.0.1
Changes since 11.0.0-rc2
Reuse the update-stage arrays in the watch tests.
Return DefaultHttpContext and put the controller-test call token last.
Return DefaultHttpContext and put the test call token last.
Return the gRPC Empty tasks from the session test helpers.
Assert the session-access outcomes and put the call token last.
Read the first DevTools page by index.
Cancel the WebView2 ready timer when initialization finishes.
Use one constant for a malformed relay ticket error.
Collect CORS origins with LINQ.
Share the unknown session label and move channel notification out of Shutdown.
Share the create-failed prefix and log the cancelled ping with its exception.
Log file-watch events with templates and isolate the allowed-root check.
Await cancellation when a session ends and drop the extra SuppressFinalize.
Guard client connection keys with System.Threading.Lock.
Guard the session controller list with System.Threading.Lock.
Count live shop sessions with LINQ instead of a manual loop.
Filter relay cookies with Where instead of a counted loop.
Move shop-enrollment and newest-launch checks out of the registry methods.
Replace the nested ternary that trims metric text.
Fill the non-HTTP access catch and use Any for the requester label.
Fix SonarCloud vulnerabilities (5), bugs (10), and blockers (7) (#130)
Fix .NET 11 build warnings (NU1510, ASPDEPR011) and Node 20 GitHub Actions deprecations (#128)
Fix SonarCloud security vulnerabilities and BLOCKER _cts disposal (#129)
CI: preserve multi-file WPF Release publish layout on net11
Fix accidental 11.0.1.10/11.0.1.100 replacement and stale branch name in ReleaseProcess.md
Sync net10 changes to net11 and bump to 11.0.1.1 (#122)
Tests: wait for the relay's file totals before checking them
Merge branch 'claude/net11-port-shared-control': net10's shared control work on the released .NET 11 (11.0.0)
net11: no pack hook or package reference that net11 had already removed
Release process doc: net11 numbers and how EditWebView runs on this line
Upstream source from aspnetcore 11.0.0 and MAUI 11.0.10 (EditWebView run)
net11: keep net11's own module-initializer end-to-end tests
net11: the ported cache test passes the cache-control value net11's helper needs
net11 on the released .NET 11: SDK 11.0.100, packages 11.0.0, version 11.0.0
Port net10 since the last sync: shared control, owner key, sign-in providers, opt-in session bar
Document EditWebView in the release process.
Merge pull request #80 from budcribar/claude/net11-escape-release-notes
Escape commas and semicolons in the release notes passed to dotnet pack
Merge pull request #77 from budcribar/claude/net11-port-net10-release
Retarget the ported net10 projects to net11
Prepare NuGet release packaging, CI test coverage, and remote component contract hardening
RemoteComponentHost: ExitWhenInputCloses, exit when stdin ends instead of polling
Keep remote component frames from restarting when the app is mirrored
Mark agent registry (AgentHub/AgentAdmin) experimental (RWV001)
Restore Authorization package references in RemoteWebViewService.Lib
Describe agents and the embedded relay without naming one app
Remote components README: use a generic contract example
Remote components: describe the use generically
Add the [RemoteComponentContract] source generator
Add remote components: runtime and the WPF RemoteComponentHost
Add ReverseMirror to [RemoteBlazor]
Add the [RemoteBlazor] source generator
Port the net9 test-runner and window-sizing fixes.
Install nvm-windows when RunTests.ps1 cannot find nvm.
Throw the frame-ancestor error after the scan.
Name the first invalid frame ancestor after valid ones.
Merge pull request #66 from budcribar/net11-bugbounty-fixes
Port Bug02, Bug03 (dispose-on-throw), Bug06, Bug15, Bug44, and Bug60 fixes and regression tests
Full list: https://github.com/budcribar/RemoteBlazorWebView/compare/11.0.0-rc2...0ffabecb9690132ce65cab32ffe272e7a0f62d0a