-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable customising delegated http router (#654)
Allow passing delegated routing client options, e.g. IPIP-484 filters, to the delegated HTTP router. --------- Co-authored-by: Daniel N <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
- Loading branch information
1 parent
8364296
commit 693c82d
Showing
4 changed files
with
27 additions
and
6 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
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
8 changes: 8 additions & 0 deletions
8
packages/routers/src/utils/delegated-http-routing-defaults.browser.ts
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { DelegatedRoutingV1HttpApiClientInit } from '@helia/delegated-routing-v1-http-api-client' | ||
|
||
export function delegatedHTTPRoutingDefaults (): DelegatedRoutingV1HttpApiClientInit { | ||
return { | ||
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'], | ||
filterAddrs: ['https', 'webtransport', 'webrtc', 'webrtc-direct', 'wss'] | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/routers/src/utils/delegated-http-routing-defaults.ts
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { DelegatedRoutingV1HttpApiClientInit } from '@helia/delegated-routing-v1-http-api-client' | ||
|
||
export function delegatedHTTPRoutingDefaults (): DelegatedRoutingV1HttpApiClientInit { | ||
return { | ||
filterProtocols: ['unknown', 'transport-bitswap', 'transport-ipfs-gateway-http'], | ||
filterAddrs: ['https', 'tcp', 'webrtc', 'webrtc-direct', 'wss'] | ||
} | ||
} |