Skip to content

21dh114172/cronet-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cronet-go

Cronet is the Chromium network stack made available as a library. Cronet takes advantage of multiple technologies that reduce the latency and increase the throughput of the network requests.

The Cronet Library handles the requests of apps used by millions of people on a daily basis, such as YouTube, Google App, Google Photos, and Maps - Navigation & Transit.

Build

Cronet binaries

Precompiled

See sleeyax/cronet-binaries for prebuilt cronet binaries.

Manual compilation

  1. Build cronet locally by following the instructions for Desktop builds from Google.
  2. Copy all shared libraries from ~/chromium/src/out/Cronet/*.so to ./build/<os>/<arch>.
  3. Rename libcronet.x.x.x.x.so to libcronet.so.
  4. (optional) If you have a sysroot folder (e.g. for cross-compilation), copy it to ./build/<os>/<arch>/sysroot.

Package

Before you begin, make sure you've followed the instructions above and have the prebuild and build utilities compiled:

$ go build -v -o prebuild ./cmd/prebuild
$ go build -v -o gobuild ./cmd/build

Then, download the required toolchain for your system:

$ ./prebuild

You only need to do these steps once per project.

Finally, build the example program with the build utility:

# dynamic linking
$  ./gobuild -v -o example ./cmd/example/main.go
# static linking (if enabled)
$ ./gobuild -v -o example -tags cronet_static -trimpath -ldflags "-s -w -buildid=" ./example
$ ./build/llvm/bin/llvm-strip ./example

By default, gobuild wraps the go build command. To run go test instead, specify test as the first argument:

$ ./gobuild test ./...

See the GitHub workflow for more details.

About

The Chromium network stack library for Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 65.4%
  • C 34.6%