mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-03-15 10:30:48 +00:00
Change remaining gateway.dweb.me to dweb.me
This commit is contained in:
parent
736f5d3eae
commit
5bfb1fb01c
6
API.md
6
API.md
@ -34,7 +34,7 @@ There are a set of classes:
|
|||||||
|
|
||||||
Calls are generally made through the Transports class which knows how to route them to underlying connections.
|
Calls are generally made through the Transports class which knows how to route them to underlying connections.
|
||||||
|
|
||||||
Documents are retrieved by a list of URLs, where in each URL, the left side helps identify the transport, and the right side can be the internal format of the underlying transport BUT must be identifiable e.g. ipfs:/ipfs/12345abc or https://gateway.dweb.me/content/contenthash/Qm..., this format will evolve if a standard URL for the decentralized space is defined.
|
Documents are retrieved by a list of URLs, where in each URL, the left side helps identify the transport, and the right side can be the internal format of the underlying transport BUT must be identifiable e.g. ipfs:/ipfs/12345abc or https://dweb.me/contenthash/Qm..., this format will evolve if a standard URL for the decentralized space is defined.
|
||||||
|
|
||||||
The actual urls used might change as the Decentralized Web universe reaches consensus (for example dweb:/ipfs/Q123 is an alternative seen in some places)
|
The actual urls used might change as the Decentralized Web universe reaches consensus (for example dweb:/ipfs/Q123 is an alternative seen in some places)
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ Resolves to Instance of subclass of Transport
|
|||||||
```
|
```
|
||||||
Default options should be set in each transport, but can be overwritten,
|
Default options should be set in each transport, but can be overwritten,
|
||||||
for example to overwrite the options for HTTP call it with
|
for example to overwrite the options for HTTP call it with
|
||||||
`options={ http: { urlbase: “https://gateway.dweb.me:443/” } }`
|
`options={ http: { urlbase: “https://dweb.me:443/” } }`
|
||||||
|
|
||||||
##### async p_setup1 (verbose, cb)
|
##### async p_setup1 (verbose, cb)
|
||||||
Setup the resource and open any P2P connections etc required to be done just once.
|
Setup the resource and open any P2P connections etc required to be done just once.
|
||||||
@ -460,7 +460,7 @@ It looks at `options { http }` for its options.
|
|||||||
|
|
||||||
Option|Default|Meaning
|
Option|Default|Meaning
|
||||||
------|-------|-------
|
------|-------|-------
|
||||||
urlbase|https://gateway.dweb.me:443|Connect to gateway.dweb.me for contenthash urls
|
urlbase|https://dweb.me:443|Connect to dweb.me for contenthash urls
|
||||||
supportURLS|http:*, https:*, contenthash:*}| (TODO: may in the future support `dweb:/contenthash/*`)
|
supportURLS|http:*, https:*, contenthash:*}| (TODO: may in the future support `dweb:/contenthash/*`)
|
||||||
supportFunctions|fetch, store, add, list, reverse, newlisturls, get, set, keys, getall, delete, newtable, newdatabase|
|
supportFunctions|fetch, store, add, list, reverse, newlisturls, get, set, keys, getall, delete, newtable, newdatabase|
|
||||||
supportFeatures|fetch.range|it will fetch a range of bytes if specified in {start, end} to p_rawfetch()
|
supportFeatures|fetch.range|it will fetch a range of bytes if specified in {start, end} to p_rawfetch()
|
||||||
|
@ -5,7 +5,7 @@ const Url = require('url');
|
|||||||
|
|
||||||
|
|
||||||
defaulthttpoptions = {
|
defaulthttpoptions = {
|
||||||
urlbase: 'https://gateway.dweb.me:443'
|
urlbase: 'https://dweb.me:443'
|
||||||
};
|
};
|
||||||
|
|
||||||
servercommands = { // What the server wants to see to return each of these
|
servercommands = { // What the server wants to see to return each of these
|
||||||
@ -133,7 +133,7 @@ class TransportHTTP extends Transport {
|
|||||||
p_newlisturls(cl, {verbose=false}={}) {
|
p_newlisturls(cl, {verbose=false}={}) {
|
||||||
let u = cl._publicurls.map(urlstr => Url.parse(urlstr))
|
let u = cl._publicurls.map(urlstr => Url.parse(urlstr))
|
||||||
.find(parsedurl =>
|
.find(parsedurl =>
|
||||||
((parsedurl.protocol === "https:" && parsedurl.host === "gateway.dweb.me"
|
((parsedurl.protocol === "https:" && ["gateway.dweb.me", "dweb.me"].includes(parsedurl.host)
|
||||||
&& (parsedurl.pathname.includes('/content/rawfetch') || parsedurl.pathname.includes('/contenthash/')))
|
&& (parsedurl.pathname.includes('/content/rawfetch') || parsedurl.pathname.includes('/contenthash/')))
|
||||||
|| (parsedurl.protocol === "contenthash:") && (parsedurl.pathname.split('/')[1] === "contenthash")));
|
|| (parsedurl.protocol === "contenthash:") && (parsedurl.pathname.split('/')[1] === "contenthash")));
|
||||||
if (!u) {
|
if (!u) {
|
||||||
|
@ -38,7 +38,7 @@ const defaultoptions = {
|
|||||||
// Addresses: { Swarm: [ '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star']}, // For Y - same as defaults
|
// Addresses: { Swarm: [ '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star']}, // For Y - same as defaults
|
||||||
// Addresses: { Swarm: [ ] }, // Disable WebRTC to test browser crash, note disables Y so doesnt work.
|
// Addresses: { Swarm: [ ] }, // Disable WebRTC to test browser crash, note disables Y so doesnt work.
|
||||||
Addresses: {Swarm: ['/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star']}, // from https://github.com/ipfs/js-ipfs#faq 2017-12-05 as alternative to webrtc works sort-of
|
Addresses: {Swarm: ['/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star']}, // from https://github.com/ipfs/js-ipfs#faq 2017-12-05 as alternative to webrtc works sort-of
|
||||||
//Bootstrap: ['/dns4/gateway.dweb.me/tcp/443/ws/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'], // Supposedly connects to Dweb IPFS instance, but doesnt work (nor does ".../wss/...")
|
//Bootstrap: ['/dns4/dweb.me/tcp/443/ws/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'], // Supposedly connects to Dweb IPFS instance, but doesnt work (nor does ".../wss/...")
|
||||||
},
|
},
|
||||||
//init: true, // Comment out for Y
|
//init: true, // Comment out for Y
|
||||||
EXPERIMENTAL: {
|
EXPERIMENTAL: {
|
||||||
|
@ -16,8 +16,8 @@ let defaultipfsoptions = {
|
|||||||
//start: false,
|
//start: false,
|
||||||
config: {
|
config: {
|
||||||
Addresses: { Swarm: [ '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star']},
|
Addresses: { Swarm: [ '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star']},
|
||||||
//Bootstrap: ['/dns4/gateway.dweb.me/tcp/443/wss/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'],
|
//Bootstrap: ['/dns4/dweb.me/tcp/443/wss/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'],
|
||||||
//Bootstrap: ['/dns4/gateway.dweb.me/tcp/443/ws/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'],
|
//Bootstrap: ['/dns4/dweb.me/tcp/443/ws/ipfs/QmPNgKEjC7wkpu3aHUzKKhZmbEfiGzL5TP1L8zZoHJyXZW'],
|
||||||
},
|
},
|
||||||
EXPERIMENTAL: {
|
EXPERIMENTAL: {
|
||||||
pubsub: true
|
pubsub: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user