question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues connecting via Cronet -> demo:app

See original GitHub issue

Hi!

Thanks again for your work on this project. I’ve been setting up a test environment here, to experiment with Android + Cronet HTTP/3 libs for a mobile app.

I am simply using http3_server.py with the demo:app ASGI module, but cannot get Cronet to even negotiate a connection. Here is the error:

Exception in CronetUrlRequest: net::ERR_QUIC_PROTOCOL_ERROR, ErrorCode=10, InternalErrorCode=-356, Retryable=false, QuicDetailedErrorCode=25

Here’s the relevant Cronet code:

private void callCronet() {
        CronetEngine.Builder myBuilder = new CronetEngine.Builder(this);
        cronetEngine = myBuilder
                .addQuicHint("quic.example.com", 8443, 8443)
                .enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 100 * 1024)
                .enableHttp2(true)
                .enableQuic(true)
                .build();

        Executor executor = Executors.newSingleThreadExecutor();
        UrlRequest.Callback callback = new MyUrlRequestCallback();
        UrlRequest.Builder builder = cronetEngine.newUrlRequestBuilder("https://quic.example.com:8443", callback, executor);
        UrlRequest urlRequest = builder.build();
        urlRequest.getStatus(new UrlRequest.StatusListener() {
            @Override
            public void onStatus(int status) {
                Log.e(TAG, status + " ");
            }
        });
        urlRequest.start();
    }

    private void callQuicCronet() {
        CronetEngine.Builder myBuilder = new CronetEngine.Builder(this);
        cronetEngine = myBuilder
                .enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 100 * 1024)
                .enableHttp2(true)
                .enableQuic(true)
                .addQuicHint("quic.tech", 8443, 8443)
                .build();

        Executor executor = Executors.newSingleThreadExecutor();
        UrlRequest.Callback callback = new MyUrlRequestCallback();
        UrlRequest.Builder builder = cronetEngine.newUrlRequestBuilder("https://quic.tech:8443", callback, executor);
        UrlRequest urlRequest = builder.build();
        urlRequest.getStatus(new UrlRequest.StatusListener() {
            @Override
            public void onStatus(int status) {
                Log.e(TAG, status + " ");
            }
        });
        urlRequest.start();
    }

We are able to connect without issue to the public QUIC endpoints above; for this local setup we have signed Let’s Encrypt certs and are using the following command line to serve a one line index.html from examples/htdocs:

python3 examples/http3_server.py --certificate certs/fullchain1.pem --private-key certs/privkey1.pem --host quic.example.com --port 8443 -v -q quiclog "demo:app"

Any ideas?

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jlainecommented, Mar 26, 2020

I can only speak for quic.aiortc.org which runs:

python examples/http3_server.py --certificate demo/ssl_cert.pem --private-key demo/ssl_key.pem --port 443 --quic-log examples/htdocs/logs

0reactions
VernonPerrycommented, Mar 26, 2020

Thanks jlaine. We’ve got a different approach for Android that I am exploring today, I will keep you posted with developments. Thanks for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Perform network operations using Cronet - Android Developers
Asynchronous requests​​ Network requests issued using the Cronet Library are asynchronous by default. Your worker threads aren't blocked while ...
Read more >
hQUIC Kit - Huawei Developer
Learn to integrate hQUIC Kit for faster network connection, stronger packet loss resistance, and higher throughput.
Read more >
arrow_drop_down - Monorail
Issue 2479: i build apprtc for android native , but i didn`t demo app with peerconnection to connect with https://apprtc.appspot.com/?r=.
Read more >
Quick Start Guide to Using Cronet
Cronet is the networking stack of Chromium put into a library for use on mobile. ... Typical errors include hostname // not resolved,...
Read more >
RELEASENOTES.md - google/ExoPlayer - Sourcegraph
Fix session tracking problem with fast seeks in `PlaybackStatsListener` ... demo app use the Cronet and IMA extensions by default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found