Open chrisekelley opened 6 years ago
Testing on my iPad
It progresses a little further on this real device compared to the emulator: it displays a "Server error" message after trying to load the Bunsen UI dat. Log:
2018-11-25 18:39:08.093250+0100 Bunsen[248:4453] Loading Bunsen UI from datUri:http://localhost:3000/bunsen.hashbase.io/
2018-11-25 18:39:08.144133+0100 Bunsen[248:4453] connected
2018-11-25 18:39:08.144242+0100 Bunsen[248:4453] pingstatus: connected
2018-11-25 18:39:08.243682+0100 Bunsen[248:4511] WF: === Starting WebFilter logging for process Bunsen
2018-11-25 18:39:08.243776+0100 Bunsen[248:4511] WF: _userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
noOverridingAllowed = 1;
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
2018-11-25 18:39:08.243967+0100 Bunsen[248:4511] WF: _WebFilterIsActive returning: NO
2018-11-25 18:39:08.253131+0100 Bunsen[248:4453] iframe onload
I'm pretty sure this is the same very-longuuid.localhost:3000 error as before.
Taking a deeper look at dat-gateway, which is a proxy server for dats. This may be an opportunity to modify dat-gateway to use bonjour/zeroconf or datdns.
I don't understand the reason for this code:
return DatLibrarian.resolve(address).then((resolvedAddress) => {
// TODO: Detect DatDNS addresses
let encodedAddress = hexTo32.encode(resolvedAddress)
let redirectURL = `http://${encodedAddress}.${urlParts.host}/${path}${urlParts.search || ''}`
@RangerMauve or @rjsteinert : Why do we need to hexTo32 encode the resolved address? Is this a browser limitation?
Update: Nevermind fellas, answer is in the docs: https://github.com/RangerMauve/dat-gateway#subdomain-redirection
Please note that due to limitations in how URLs work, the dat key will be converted to it's base32 representation instead of hexadecimal
Also - to get the ios version working, I could simply not use the redirect flag.
By default dat-gateway will serve all dats from the same origin. This means that dats using absolute URLs (starting with /) will be broken. This also means that all dats will share the same localStorage and indexedDB instances which can cause security issues.
In order to resolve these issues, you can use the --redirect flag in conjunction with the lvh.me domain to have each dat served on a subdomain.
Still, need to find a way to enable each dat to have their own localStorage and indexedDB instances.
Probably the safest, most direct (quickest) way to do this for IOS is to use an external host as proxy for the dat requests, like @RangerMauve 's mauve.moe, so we can still keep the subdomains.
Does .lvh.me work as opposed to .localhost?
I'm really close to having an IOS version of Bunsen browser available; however, I've run into a roadblock: IOS won't resolve domain names like long-uuid.localhost:3000, which are created by dat-gateway in order to ensure cookie security for each dat.
I have added a link to the dat-gateway home inside the loading div so I can try to fetch a dat directly from there. Here is the error message I receive:
Is there a way to do this on IOS without using a subdomain? Or - is there a way to register a localhost subdomain on the local IOS DNS lookup? Would Bonjour be an option? watson/bonjour looks pretty easy to bolt into dat-gateway.
On a side note, there is another error, but I don't think it is related to the domain issue:
Looks like there is no Safari support for registerProtocolHandler.