Class GatewayHost
Acts as a bridge between traditional web browsers and IPFS. Through the gateway, users can browse files and websites stored in IPFS as if they were stored in a traditional web server.
Implements
Inherited Members
Namespace: Ipfs.HttpGateway
Assembly: Ipfs.HttpGateway.dll
Syntax
public class GatewayHost : IDisposable
Constructors
| Improve this Doc View SourceGatewayHost(ICoreApi)
Creates a web host that bridges IPFS and HTTP on "http://127.0.0.1:8080"
Declaration
public GatewayHost(ICoreApi ipfs)
Parameters
Type | Name | Description |
---|---|---|
ICoreApi | ipfs | The IPFS core features. |
Remarks
This starts the web host on a separate thread. Use the Dispose method to stop the web host.
GatewayHost(ICoreApi, String)
Creates a web host that bridges IPFS and HTTP on the specified URL.
Declaration
public GatewayHost(ICoreApi ipfs, string url)
Parameters
Type | Name | Description |
---|---|---|
ICoreApi | ipfs | The IPFS core features. |
String | url | The url to listen on, typically something like "http://127.0.0.1:8080". A random port can assigned via "http:/127.0.0.1:0". |
Remarks
Use the Dispose method to stop the web host.
Properties
| Improve this Doc View SourceServerUrl
Gets an URL to the server.
Declaration
public string ServerUrl { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
IpfsUrl(String)
Gets the url to the IPFS path.
Declaration
public string IpfsUrl(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path to an IPFS file or directory. For example, "Qmhash" or "Qmhash/this/and/that". |
Returns
Type | Description |
---|---|
String | The fully qualified URL to the IPFS |