GatewayConfig class
Configuration for the IPFS HTTP Gateway.
Constructors
-
GatewayConfig({bool enabled = false, int port = 8080, String address = '0.0.0.0', bool writable = false, bool enableCache = true, 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}) -
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
- autoTlsDomain → String?
-
Primary domain for the ACME certificate.
final
- autoTlsEmail → String?
-
Contact email for the ACME account.
final
- autoTlsProvider → String
-
ACME provider name (e.g.
letsencrypt,zerossl).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
- 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.localhostand*.ipns.localhostsubdomains are supported.final - hashCode → int
-
The hash code for this object.
no setterinherited
- 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
.ipnssubdomains.final - subdomainTLSRedirect → bool
-
Whether to redirect HTTP subdomain requests to HTTPS.
Never enabled for
localhostor127.0.0.1to avoid redirect loops.final - tlsPort → int
-
The port the TLS server listens on.
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