Coder Social home page Coder Social logo

anders0913 / rawquic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonysuqin/rawquic

0.0 0.0 0.0 2.02 MB

基于Chromium 82.0.4061.2 quiche库QuicTransport协议实现的原生QUIC客户端库,去掉HTTP2/SPDY,封装了类Socket接口,可以收发裸QUIC数据。

C++ 94.36% C 5.64%

rawquic's Introduction

RawQuic

This project transmits raw quic data on client side without http2/spdy, but in QuicTransport protocol. [Draft] [Design].

This function provides ability to replace TCP with QUIC for some app, such as "RTMP OVER QUIC" which already implemented by Tencent not long before.

There's a simple QuicTransport echo server "quic_transport_simple_server" in chromium, and our formal support will be added on nginx-quic RTMP module with "RTMP OVER QUIC" function soon.

Chromium commit

4f9161f264b29ca04c466e37ae91497d3420e9cc, after tag 81.0.4008.1.

You should build chromium and be able to continue to follow steps.

Build librawquic

Patch RawQuic to chromium

mv RAW_QUIC_REPOSITORY_DIR/src/raw_quic CHROMIUM_ROOT_DIR/src/net/quic/

Patch net/BUILD.gn

Add codes below to net/BUILD.gn.

shared_library("librawquic") {
  sources = [
    "quic/raw_quic/streambuf/basic_streambuf.hpp",
    "quic/raw_quic/streambuf/basic_streambuf_fwd.hpp",
    "quic/raw_quic/streambuf/buffer.hpp",
    "quic/raw_quic/streambuf/streambuf.hpp",
    "quic/raw_quic/raw_quic.cc",
    "quic/raw_quic/raw_quic.h",
    "quic/raw_quic/raw_quic_api.cc",
    "quic/raw_quic/raw_quic_api.h",
    "quic/raw_quic/raw_quic_context.cc",
    "quic/raw_quic/raw_quic_context.h",
    "quic/raw_quic/raw_quic_session.cc",
    "quic/raw_quic/raw_quic_session.h",
  ]
  deps = [
    ":net",
    ":simple_quic_tools",
    "//base",
    "//third_party/boringssl",
    "//third_party/protobuf:protobuf_lite",
  ]
  defines = [ "RAW_QUIC_EXPORTS", "RAW_QUIC_SHARED_LIBRARY" ]
}

Generate project on specified platform

gn gen out/Debug --args="is_debug=true target_cpu=\"x86\""

Build

ninja -C out\Debug librawquic

Test

Build and run server demo

Build test echo server quic_transport_simple_server and run.

ninja -C out\Debug quic_transport_simple_server

Build and run client demo

See sample code test/raw_quic_test.cpp

Enjoy it.

rawquic's People

Contributors

sonysuqin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.