在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:devsisters/goquic开源软件地址:https://github.com/devsisters/goquic开源编程语言:C 84.3%开源软件介绍:goquic, QUIC support for GoThis is a work-in-progress QUIC implementation for Go. This is based on libquic library, which is in turn based on original QUIC implementation on Chromium. QUIC is an experimental protocol aimed at reducing web latency over that of TCP. On the surface, QUIC is very similar to TCP+TLS+SPDY implemented on UDP. Because TCP is implement in operating system kernels, and middlebox firmware, making significant changes to TCP is next to impossible. However, since QUIC is built on top of UDP, it suffers from no such limitations. Key features of QUIC over existing TCP+TLS+SPDY include
Project StatusThis library is highly experimental. Although Known issues:
Things to do:
Preliminary BenchmarksA very primitive benchmark testing have been done. Testing environments below:
The server code is modified to create 30B, 1kB, 5kB, 10kB HTTP body payload. Concurrency is 200 and each thread requests 1,000 requests. It is designed to measure ideal throughput of the server. Naturally the throughput goes down when concurrency increases. Benchmark results:
On 10kB case, calculating the total network throughput is How many connections per second can this server process?
Turning off keepalive using Getting StartedGet source filesgo get -u -d github.com/devsisters/goquic -u option is needed, because building (or downloading) static libraries is necessary for building and installing goquic library. Build static library filesAlthough prebuilt static library files already exists in the repository for convenience, it is always good practice to build library files from source. You should not trust any unverifiable third-party binaries. To build the library files for your architecture and OS: ./build_libs.sh (for debug build)
GOQUIC_BUILD=Release ./build_libs.sh (for release build) This will fetch To build static library files, you should have cmake, C/C++ compiler, and ninja-build system (or GNU make). Currently Linux, Mac OS X and FreeBSD is supported. How to buildIf you are using Go >= 1.5, you can build goquic binaries without any extra work. go build $GOPATH/src/github.com/devsisters/goquic/example/server.go If you are using Go 1.4, you should open goquic.go and manually edit ${SRCDIR} with your real path (maybe /YOUR/GOPATH/src/github.com/devsisters/goquic). SPDY/QUIC supportWe have a experimental SPDY/QUIC implementation as a library. You can use this library to add SPDY/QUIC support for your existing Go HTTP server. See our SPDY-QUIC server/client implementation here. How to use serverWhen running a HTTP server, do: goquic.ListenAndServe(":8080", 1, nil) instead of http.ListenAndServe(":8080", nil) How to use clientYou need to create http.Client with Transport changed, do: client := &http.Client{
Transport: goquic.NewRoundTripper(false),
}
resp, err := client.Get("http://example.com/") instead of resp, err := http.Get("http://example.com/") |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论