Skip to content

Latest commit

 

History

1,013 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo WopiHost

Build & Test codecov Code Coverage Maintainability CodeFactor FOSSA Status .NET Core

WopiHost community survey — tell us what you built, takes 3 minutes

A modular WOPI host implementation for .NET that lets you plug your own data source into Office Online Server, Microsoft 365 for the Web, or any other WOPI client by implementing a small set of interfaces.

Packages

Package What it does Version Downloads
WopiHost.Abstractions Interfaces every other package builds on (IWopiStorageProvider, IWopiLockProvider, IWopiPermissionProvider, IWopiAccessTokenService) NuGet NuGet
WopiHost.Core The WOPI server — Minimal-API endpoints, JWT auth, proof validation (AddWopi() + app.MapWopiEndpoints(), ConfigureWopiSecurity()) NuGet NuGet
WopiHost.Discovery Reads the WOPI client's discovery XML (IDiscoverer, IDiscoveryFileProvider) NuGet NuGet
WopiHost.Url Builds the URLs you embed in iframes (WopiUrlBuilder, WopiUrlSettings) NuGet NuGet
WopiHost.FileSystemProvider Reference storage backed by a directory tree NuGet NuGet
WopiHost.MemoryLockProvider In-process lock store (single instance / dev) NuGet NuGet
WopiHost.AzureStorageProvider Storage backed by Azure Blob Storage NuGet NuGet
WopiHost.AzureLockProvider Distributed lock store backed by Azure Blob leases (strongest cross-instance exclusion) NuGet NuGet
WopiHost.RedisLockProvider Best-effort distributed lock store backed by Redis (conditional CAS via SET IFEQ/DELIFEQ, requires Redis 8.4+) NuGet NuGet
WopiHost.Cobalt Optional MS-FSSHTTP support (off by default; needs the private Microsoft.CobaltCore feed — see Cobalt) not published

Why use it?

  • Modular architecture — selective integration via 10 dedicated NuGet packages, clean separation between protocol, storage, and locking.
  • Flexible storage — implement IWopiStorageProvider to put any backend behind WOPI: file system, blob storage, database, custom APIs. See Extending WopiHost.
  • Comprehensive WOPI compliance — file operations, container operations, ecosystem support, and the bootstrapper endpoint for Office mobile.
  • WOPI discovery built in — dynamic capability detection from the WOPI client with template resolution and caching.
  • Enterprise-ready security — WOPI proof validation, origin checking, JWT access tokens, pluggable permission/ACL providers.
  • .NET Aspire integration — service orchestration, OpenTelemetry, container support out of the box.
  • Optional Cobalt (MS-FSSHTTP) — for OOS clients that prefer the more efficient co-authoring protocol.

Quick start

Prerequisites

Run

git clone https://github.com/petrsvihlik/WopiHost.git
cd WopiHost
dotnet run --project infra/WopiHost.AppHost

The Aspire dashboard opens automatically and starts:

Resource What it is
wopihost-collabora WOPI backend (Collabora lane); OpenAPI at /scalar
wopihost-web-collabora Sample frontend (file picker + iframe) wired to Collabora
collabora Collabora Online (CODE) container — real WOPI client for end-to-end editing
wopihost-onlyoffice A second WOPI backend (ONLYOFFICE lane)
wopihost-web-onlyoffice A second sample frontend wired to ONLYOFFICE
onlyoffice ONLYOFFICE Docs container — a second real WOPI client
wopihost-validator WOPI protocol validator

Each editor runs in its own lane — a dedicated backend + frontend — so they can be tested side by side. To skip a Docker image you don't want, see the AppHost README.

The dashboard shows the URL each resource is bound to — Aspire allocates ports dynamically for the frontends, so they change between runs. The first run pulls the collabora/code Docker image (~1 GB) and the larger onlyoffice/documentserver image (~4.3 GB) and takes a few minutes; if you don't want the dependency, set "AppHost:UseCollabora": false and/or "AppHost:UseOnlyOffice": false in infra/WopiHost.AppHost/appsettings.Development.json.

Aspire dashboard showing both editor lanes (Collabora + ONLYOFFICE) running

Documentation

Everything beyond the basics lives in the wiki:

Topic What's there
Architecture How the libraries, providers, frontend, and WOPI client fit together at runtime.
Configuration Wopi:* and AppHost:* knobs (Azure storage, OIDC sample, etc.).
Hosting IIS, HTTPS, Docker, running individual projects, older runtimes.
Collabora Online End-to-end editing with CODE — AppHost wiring, NetZone / proof-key gotchas.
Extending WopiHost Custom storage and lock providers, permissions, the minimal-host snippet.
CheckFileInfo customization Overriding the response payload via IWopiHostExtensions hooks.
Bootstrap endpoint Wiring /wopibootstrapper for Office mobile.
Cobalt What MS-FSSHTTP buys you, and how to enable the optional Cobalt build.
Useful resources · Interesting WOPI projects Specs, external write-ups, other implementations worth a look.

Compatible WOPI clients

Client Status Notes
Office Online Server 2016+ Production Microsoft only supports the latest version; WopiHost tracks the same. Deployment guide.
Microsoft 365 for the Web Production Requires CSPP onboarding plus implementing the M365-specific feature surface. The provided sample passes the WOPI-Validator.
Collabora Online (CODE) Development / CI only Free and redistributable, runs as a Docker container. Useful for end-to-end testing without a Microsoft license; not a substitute for OOS or M365. See the wiki for the AppHost wiring.
ONLYOFFICE Docs Development / CI only Free Community edition, runs as a Docker container. A second independent WOPI client for end-to-end testing alongside Collabora; not a substitute for OOS or M365.

License

About

The most advanced .NET implementation of the WOPI protocol. Enables integration with WOPI clients such as Office Online Server.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

219 stars

Watchers

19 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages