Skip to content

Latest commit

 

History

History
 
 

car

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

HTTP Gateway backed by a CAR File

This is an example that shows how to build a Gateway backed by the contents of a CAR file. A CAR file is a Content Addressable aRchive that contains blocks.

Build

> go build -o car-gateway

Usage

First of all, you will need some content stored as a CAR file. You can easily export your favorite website, or content, using:

ipfs dag export <CID> > data.car

Then, you can start the gateway with:

./car-gateway -c data.car -p 8040

Subdomain gateway

Now you can access the gateway in localhost:8040. It will behave like a regular Subdomain IPFS Gateway, except for the fact that all contents are provided from the CAR file. Therefore, things such as IPNS resolution and fetching contents from nodes in the IPFS network won't work.

Path gateway

If you don't need Origin isolation and only care about hosting flat files, a plain path gateway at 127.0.0.1:8040 may suffice.