-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support request_internet_access again #2988
Conversation
HttpResponse httpResponse = rpc.getHttpResponse(dcContext.getAccountId(), rawUrl); | ||
String mimeType = httpResponse.getMimetype(); | ||
if (mimeType == null) { | ||
mimeType = "application/octet-stream"; | ||
} | ||
return new WebResourceResponse(mimeType, httpResponse.getEncoding(), new ByteArrayInputStream(httpResponse.getBlob())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because otherwise normal traffic is redirected to the fake proxy introduced in #2539 but while this works with the webxdc-test app that loads the delta.chat page, the maps app doesn't work because OSM is not happy about the wrong user agent core is sending:
Ideally core should be fixed because otherwise the browsing will not respect the core proxy set like the "show full message" does, otherwise just not setting this fake proxy when internetAccess == true would be the simplest solution (ignoring the network leaks out of the configured proxy, but I suspect WebRTC also doesn't respect this proxy? otherwise that would have been used to disable it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @link2xt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technical requirements at https://operations.osmfoundation.org/policies/tiles/ also say we should cache the tiles. With current approach it looks like caching will not happen.
Probably better disable proxy if web access is requested and let WebView control all HTTP headers, including caching, and persist connections.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do that, I am a bit worried about the inconsistent usage of the set sock proxy in DC, it is used only for "show full message" and it might cause false expectations we don't say anything about this traffic in Webxdc not being routed to the set proxy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also leaflet plugins for caching, like https://github.com/MazeMap/Leaflet.TileLayer.PouchDBCached
I think it would still make sense to use core, we could add support for defining http headers in the jsonrpc method. core respects socks5 proxy (for example tor) and on desktop we might not be able to replicate this, as dns block seem to be for the whole app there (all windows at once), or whitelisting some domains, like we currently do for mapbox.
To test the changes in this pull request, install this apk: |
To test the changes in this pull request, install this apk: |
close #2987