GatewayConfig class

Configuration for the IPFS HTTP Gateway.

Constructors

GatewayConfig({bool enabled = false, int port = 8080, String address = '0.0.0.0', @Deprecated('The gateway is read-only; this option is ignored.') bool writable = false, @Deprecated('No gateway response cache exists; this option is ignored.') bool enableCache = true, @Deprecated('No gateway response cache exists; this option is ignored.') int cacheSize = 104857600, String? gatewayDomain, bool enableSubdomainGateway = false, bool subdomainDNSLinkResolver = true, bool subdomainTLSRedirect = false, bool enableTls = false, String? certificatePath, String? privateKeyPath, String? certificatePassword, bool autoTls = false, String? autoTlsDomain, String? autoTlsEmail, String autoTlsProvider = 'letsencrypt', bool autoTlsAcceptTos = false, List<String> autoTlsSANs = const [], int tlsPort = 443, bool redirectHttpToHttps = false, List<String> corsOrigins = const ['http://localhost', 'http://127.0.0.1'], String? autoTlsAccountKeyPath, String? autoTlsCertificatePath, String? autoTlsPrivateKeyPath, int autoTlsRenewalThresholdDays = 30, bool trustForwardedHeaders = false, int maxFileResponseBytes = unixfsReadDefaultMaxBytes, int maxCarResponseBytes = carExportDefaultMaxBytes})
Creates a new GatewayConfig.
const
GatewayConfig.fromJson(Map<String, dynamic> json)
Creates a GatewayConfig from a JSON map.
factory

Properties

address → String
The address the gateway listens on.
final
autoTls → bool
Whether to obtain and renew certificates automatically via ACME. Off by default and requires explicit autoTlsAcceptTos.
final
autoTlsAcceptTos → bool
Whether the operator has accepted the ACME provider's terms of service. AutoTLS refuses to run when this is false.
final
autoTlsAccountKeyPath → String?
Filesystem path to the ACME account key for AutoTLS.
final
autoTlsCertificatePath → String?
Filesystem path to the AutoTLS certificate.
final
autoTlsDomain → String?
Primary domain for the ACME certificate.
final
autoTlsEmail → String?
Contact email for the ACME account.
final
autoTlsPrivateKeyPath → String?
Filesystem path to the AutoTLS private key.
final
autoTlsProvider → String
ACME provider name (e.g. letsencrypt, zerossl).
final
autoTlsRenewalThresholdDays → int
Number of days before certificate expiration to trigger renewal.
final
autoTlsSANs → List<String>
Additional subject alternative names for the ACME certificate.
final
cacheSize → int
The maximum size of the gateway cache in bytes.
final
certificatePassword → String?
Optional password for the encrypted private key file. Never log this value.
final
certificatePath → String?
Filesystem path to the PEM-encoded TLS certificate.
final
corsOrigins → List<String>
Allowed CORS origins for the HTTP gateway.
final
enableCache → bool
Whether to enable caching for gateway responses.
final
enabled → bool
Whether the gateway is enabled.
final
enableSubdomainGateway → bool
Whether subdomain gateway support is enabled.
final
enableTls → bool
Whether to terminate TLS for HTTPS and WSS gateway traffic.
final
gatewayDomain → String?
The configured gateway domain for subdomain requests (e.g. ipfs.example.com). When null, only *.ipfs.localhost and *.ipns.localhost subdomains are supported.
final
hashCode → int
The hash code for this object.
no setterinherited
maxCarResponseBytes → int
Maximum total payload bytes a generated CAR archive may contain. Defaults to 1 GiB; exceeding it fails the request with HTTP 416.
final
maxFileResponseBytes → int
Maximum number of bytes a single gateway file response will buffer and serve. Defaults to unixfsReadDefaultMaxBytes (512 MiB); responses that would exceed the budget are answered with HTTP 413.
final
port → int
The port the gateway listens on.
final
privateKeyPath → String?
Filesystem path to the PEM-encoded TLS private key.
final
redirectHttpToHttps → bool
Whether the plain HTTP port should redirect all requests to HTTPS. Only meaningful when enableTls is true.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subdomainDNSLinkResolver → bool
Whether DNSLink resolution is enabled for .ipns subdomains.
final
subdomainTLSRedirect → bool
Whether to redirect HTTP subdomain requests to HTTPS. Never enabled for localhost or 127.0.0.1 to avoid redirect loops.
final
tlsPort → int
The port the TLS server listens on.
final
trustForwardedHeaders → bool
Whether to trust X-Forwarded-Host / X-Forwarded-Proto request headers when computing redirect targets for the subdomain gateway.
final
writable → bool
Whether the gateway is writable (allows POST/PUT).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this configuration to a JSON map.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited