SocketJack.WPF 1.5.0

dotnet add package SocketJack.WPF --version 1.5.0
                    
NuGet\Install-Package SocketJack.WPF -Version 1.5.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SocketJack.WPF" Version="1.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SocketJack.WPF" Version="1.5.0" />
                    
Directory.Packages.props
<PackageReference Include="SocketJack.WPF" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SocketJack.WPF --version 1.5.0
                    
#r "nuget: SocketJack.WPF, 1.5.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SocketJack.WPF@1.5.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SocketJack.WPF&version=1.5.0
                    
Install as a Cake Addin
#tool nuget:?package=SocketJack.WPF&version=1.5.0
                    
Install as a Cake Tool

SocketJack.WPF

SocketJack WPF Icon

NuGet License: MIT

WPF extension for SocketJack that adds live control sharing over the network. Share any FrameworkElement — a Canvas, Grid, Border, or entire Window — as a JPEG stream to a remote peer, and let the viewer interact with it as if it were local. Mouse input is automatically forwarded back and replayed on the original element.

Built on top of the full SocketJack networking stack: System.Text.Json serialization, TCP/UDP/WebSocket transports, peer-to-peer relay, compression, and TLS encryption.

Target frameworks: .NET 8 · .NET 9 · .NET 10


How It Works

  1. Sharer calls element.Share(client, peer, fps) — captures the element as a JPEG bitmap each frame and streams ControlShareFrame messages via P2P.
  2. Viewer calls client.ViewShare(image, peer) — decodes incoming frames into a WPF Image and forwards mouse events back to the sharer.
  3. Mouse clicks and moves on the viewer are replayed on the original element as real input events.

Getting Started

Install-Package SocketJack.WPF

Examples

Sharing a Control

using SocketJack.Net;
using SocketJack.Net.P2P;
using SocketJack.WPF;

// Both 'client' and 'peer' must already be connected and identified.
IDisposable shareHandle = myCanvas.Share(client, peer, fps: 10);

// Stop sharing
shareHandle.Dispose();

Viewing a Shared Control

using System.Windows.Controls;
using SocketJack.Net;
using SocketJack.WPF;

var viewer = client.ViewShare(sharedImage, sharerPeer);

// Dispose when finished
viewer.Dispose();

Full Example

A typical setup uses two application instances connected through a TcpServer. One shares a control, the other views it.

XAML (both instances):

<Image x:Name="SharedImage" Stretch="Uniform" />

Sharer (Instance A):

Identifier remotePeer = client.Peers.FirstNotMe();
IDisposable shareHandle = GameCanvas.Share(client, remotePeer, fps: 10);

Viewer (Instance B):

Identifier remotePeer = client.Peers.FirstNotMe();
var viewer = client.ViewShare(SharedImage, remotePeer);

HTTP Live Streaming with BroadcastServer

BroadcastServer turns any HttpServer into a live video relay. Point OBS (or any RTMP encoder) at the server and viewers can watch in a browser or VLC — no additional dependencies required.

OBS streaming to SocketJack HttpServer via BroadcastServer

using SocketJack.Net;

// Create the HTTP server
var server = new HttpServer(port: 8080);

// Attach BroadcastServer and register the default streaming routes:
//   GET  /stream       — HTML player page (mpegts.js)
//   GET  /stream/data  — raw FLV relay for the player / VLC
//   PUT  /Upload       — OBS Custom Output (HTTP)
//   POST /Upload       — OBS Custom Output (HTTP)
//   RTMP rtmp://host:port/live  — OBS RTMP publish
var broadcast = new BroadcastServer(server);
broadcast.Register();

// Start listening
server.Listen();

// The stream key is auto-generated. In OBS set:
//   Server:     rtmp://localhost:8080/live
//   Stream Key: <broadcast.StreamKey>
Console.WriteLine("Stream Key: " + broadcast.StreamKey);

// Viewers open http://localhost:8080/stream in a browser,
// or play http://localhost:8080/stream/data directly in VLC.

// Optional: poll stats once per second
while (true) {
    var stats = broadcast.UpdateStats();
    if (stats.Active) {
        Console.WriteLine(
            stats.BitrateKbps.ToString("N0") + " kbps | " +
            stats.VideoFrames + " video | " +
            stats.AudioFrames + " audio | " +
            BroadcastServer.FormatBytes(stats.TotalBytes));
    }
    Thread.Sleep(1000);
}

SocketJack Core Features

This package includes the full SocketJack library. All core networking features are available:

Category Highlights
Transport Unified TcpClient / TcpServer, UdpClient / UdpServer, and WebSocket API.
Serialization System.Text.Json with pluggable ISerializer, type whitelist/blacklist.
Peer-to-Peer Automatic discovery, relay-based NAT traversal, metadata propagation.
Compression GZipStream / DeflateStream with configurable CompressionLevel.
Performance Async I/O, automatic segmentation, bandwidth throttling.
Security SslStream TLS 1.2, X509Certificate authentication.

TCP — Quick Start

var server = new TcpServer(port: 12345);
server.Listen();

var client = new TcpClient();
await client.Connect("127.0.0.1", 12345);

client.Send(new CustomMessage("Hello!"));

server.RegisterCallback<CustomMessage>((args) =>
{
    Console.WriteLine($"Received: {args.Object.Message}");
    args.Connection.Send(new CustomMessage("10-4"));
});

UDP — Quick Start

var server = new UdpServer(port: 12345);
server.Listen();

var client = new UdpClient();
await client.Connect("127.0.0.1", 12345);

client.Send(new CustomMessage("Hello via UDP!"));

server.RegisterCallback<CustomMessage>((args) =>
{
    Console.WriteLine($"Received: {args.Object.Message}");
});

Default Options

Must be set before creating any Client or Server instance.

NetworkOptions.DefaultOptions.UsePeerToPeer = true;

Documentation

License

SocketJack is open source and licensed under the MIT License.

Contributing

Contributions, bug reports, and feature requests are welcome! See CONTRIBUTING.md for details.


SocketJack.WPF — Live control sharing for WPF, powered by SocketJack.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SocketJack.WPF:

Package Downloads
JackDebug.WPF

Debug your WPF application easily with JackDebug.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0 72 3/2/2026
1.4.5 80 2/23/2026
1.4.4 93 2/23/2026 1.4.4 is deprecated because it has critical bugs.