A desktop module for OpenShock Desktop that intercepts PiShock API calls and redirects them through OpenShock.
This module runs a local HTTPS server that impersonates do.pishock.com. Applications that use the PiShock API will have their requests intercepted and translated into OpenShock control commands.
- Hosts file redirect — Adds a
127.0.0.1 do.pishock.comentry to the Windows hosts file so PiShock API traffic is routed to localhost. - Self-signed certificates — Generates a local CA and server certificate for
do.pishock.comto serve HTTPS. The CA can be installed into the user's trust store. - API translation — Incoming PiShock
apioperateandGetShockerInforequests are parsed and forwarded to OpenShock using share code-to-shocker mappings.
| Setting | Default | Description |
|---|---|---|
Port |
443 |
HTTPS port for the local server |
AutoStart |
true |
Start the interception server automatically on module load |
ShareCodeMappings |
{} |
Map of PiShock share codes to OpenShock shocker GUIDs |
- Windows (hosts file and certificate store management are Windows-specific)
- .NET 10.0
- OpenShock Desktop with module support
- Administrator privileges for hosts file modification
dotnet buildInterception/
├── InterceptionMain.cs # Module entry point and DI setup
├── InterceptionService.cs # HTTPS server lifecycle management
├── InterceptionConfig.cs # Module configuration model
├── Certificates/
│ └── CertificateManager.cs # CA and server certificate generation
├── HostsFile/
│ └── HostsFileManager.cs # Windows hosts file manipulation
├── Server/
│ ├── DoWebApiController.cs # PiShock API endpoint handlers
│ └── PiShockRequest.cs # PiShock request model
├── SwanToMicrosoft.cs # EmbedIO (Swan) to Microsoft.Extensions.Logging bridge
└── Ui/ # Blazor UI components (MudBlazor)
See LICENSE for details.