Overview
TheAddonHTTPTransport provides HTTP-based communication with Stremio addons. It supports both modern manifest-based addons and legacy protocol addons through automatic detection and routing.
Implementation
The HTTP transport is defined insrc/addon_transport/http_transport/http_transport.rs and implements the AddonTransport trait.
Structure
transport_url- The base URL for the addon endpointenv- Phantom data for the environment type parameter
Constructor
transport_url- The base URL of the addon (must end with/manifest.jsonor/stremio/v1)
Methods
Resource Requests
- If URL ends with
/stremio/v1- routes to legacy protocol - If URL ends with
/manifest.json- uses modern protocol - Otherwise - returns error
- All path components are percent-encoded using
URI_COMPONENT_ENCODE_SET - Extra properties are encoded using
query_params_encode
Manifest Requests
- For modern addons: directly fetches from
transport_url - For legacy addons: routes to
AddonLegacyTransport
Special Features
Cinemeta Catalog URL Override
The transport supports overriding the Cinemeta addons catalog URL for testing or custom deployments. Environment Variable:- When requesting
addon_catalog/all/community.jsonfrom the official Cinemeta URL - The transport replaces it with the custom URL if the environment variable is set
- Logs a warning message with the URL replacement details
Error Handling
Common Errors:| Error | Cause | Solution |
|---|---|---|
| ”addon http transport url must ends with /manifest.json” | URL doesn’t have correct suffix | Ensure transport URL ends with /manifest.json or /stremio/v1 |
| Network errors | Connection failures | Check network connectivity and addon availability |
| Deserialization errors | Invalid response format | Verify addon returns valid JSON in expected format |
Protocol Selection
The transport automatically selects the appropriate protocol based on the URL:Source Reference
- Main implementation:
src/addon_transport/http_transport/http_transport.rs - Legacy adapter:
src/addon_transport/http_transport/legacy/mod.rs - Transport trait:
src/addon_transport/addon_transport.rs
Related
Legacy Protocol
Learn about legacy addon protocol support
Addon Transport Trait
Core transport interface definition
