This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add config options for proxy/subdomain
- Loading branch information
Showing
2 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,46 @@ | ||
package config | ||
|
||
type GatewaySpec struct { | ||
// PathPrefixes list the set of path prefixes that should be handled by | ||
// this gateway. | ||
PathPrefixes []string | ||
|
||
// UseSubdomains indicates whether or not this gateway uses subdomains | ||
// for IPFS resources instead of paths. That is: http://CID.ipfs.GATEWAY/... | ||
// | ||
// If this flag is set, any /ipns/$id and/or /ipfs/$id paths in PathPrefixes | ||
// will be permanently redirected to http://$id.[ipns|ipfs].$gateway/. | ||
// | ||
// We do not support using both paths and subdomains for a single domain | ||
// for security reasons. | ||
UseSubdomains bool | ||
|
||
// RootRedirect is the path to which requests to `/` on this gateway | ||
// should be redirected. | ||
RootRedirect string | ||
} | ||
|
||
// Gateway contains options for the HTTP gateway server. | ||
type Gateway struct { | ||
HTTPHeaders map[string][]string // HTTP headers to return with the gateway | ||
RootRedirect string | ||
Writable bool | ||
PathPrefixes []string | ||
APICommands []string | ||
NoFetch bool | ||
|
||
// HTTPHeaders configures the headers that should be returned by this | ||
// gateway. | ||
HTTPHeaders map[string][]string // HTTP headers to return with the gateway | ||
|
||
// Writable enables PUT/POST request handling by this gateway. Usually, | ||
// writing is done through the API, not the gateway. | ||
Writable bool | ||
|
||
// FIXME: Not yet implemented | ||
APICommands []string | ||
|
||
// NoFetch configures the gateway to _not_ fetch blocks in response to | ||
// requests. | ||
NoFetch bool | ||
|
||
// GatewaySpec configures the default behavior for this gateway. | ||
GatewaySpec | ||
|
||
// PublicGateways configures behavior of known public gateways. | ||
PublicGateways map[string]*GatewaySpec | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters