Skip to content

Project: Support Cronet Go binding #282

@klzgrad

Description

@klzgrad

Any Go developers who are interested in using the core of naiveproxy in Go natively, please see my proposal and comment below:

The core of naiveproxy is namely Chromium's net stack. It's possible to expose its interface in the style of BSD socket in a library libnaive.so or libnaive.a (or more accurately libchromiumsocket.a), which then could be hooked up with a Go program via FFI. The benefit of doing this: no socks5 round trip overhead for using Chromium's net stack, and more versatile to link directly with Go's net stacks at socket/connection level. The impact of doing this: a better TLS fingerprint parrot than utls with similar Go development friendliness.

To achieve this goal:

  • I can provide the code and build system to produce the proposed libnaive.a and corresponding C headers.
  • An interested Go developer to discuss the interface definition for the Go FFI.
  • Said Go developer develops Go binding and example integration showing Chromium net stack working in Go natively.
  • Cronet's official Android build is for Java, but here the build is native and intended for use from Go. Do you @nekohasekai think it's better to use Cronet from Java or Go? I'll take it as a yes.
  • The current build produces a shared library. Do you @nekohasekai think it's better to use a static library to link with Go?
  • My Cronet build on Android still doesn't work.
  • My Cronet build doesn't work with ThinLTO.
  • I'm considering finalizing it to -connect-authority-override in the next version. Really hard to name this one. Currently it's decided as -connect-authority, as connect sufficiently defines the scope of this header, the leading - denotes its internal nature, and the suffix -override doesn't seem absolutely necessary and the lack of it doesn't introduce confusion.
  • Record optimal static linking ldflags for each arch
  • Add CI test case for cornet example and go example
  • Document diff from upstream
  • Write a specification of protocol used in Naiveproxy
  • Add -network-isolation-key header to smuggle it in and configure stream isolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions