Skip to content
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

Merged
merged 3 commits into from
Apr 24, 2024
Merged

support request_internet_access again #2988

merged 3 commits into from
Apr 24, 2024

Conversation

adbenitez
Copy link
Member

close #2987

@adbenitez adbenitez requested review from r10s and link2xt April 6, 2024 05:31
Comment on lines 274 to 279
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()));
Copy link
Member Author

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:
image

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@link2xt link2xt Apr 6, 2024

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.

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

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.

Copy link

github-actions bot commented Apr 6, 2024

To test the changes in this pull request, install this apk:
📦 app-preview.apk

Copy link

github-actions bot commented Apr 7, 2024

To test the changes in this pull request, install this apk:
📦 app-preview.apk

@adbenitez adbenitez merged commit 7afef22 into main Apr 24, 2024
2 checks passed
@adbenitez adbenitez deleted the adb/issue-2987 branch April 24, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webxdc with request_internet_access set not working on Saved Messages
3 participants