Перейти к файлу
Lars Eggert 2bc5ffc6f5
ci: Try a different formatting for the qns diff (#2257)
* ci: Try a different formatting for the qns diff

CC @martinthomson

* Fix

* Try emojis
2024-11-29 07:59:51 +00:00
.config ci: Terminate `nextest` after a test runs for three minutes (#2192) 2024-10-18 19:39:17 +00:00
.github ci: Try a different formatting for the qns diff (#2257) 2024-11-29 07:59:51 +00:00
fuzz chore: Bump some dependency versions that changed upstream (#2225) 2024-11-12 16:28:37 +00:00
hooks Clippy pedantic (#1649) 2024-02-14 11:33:12 +02:00
neqo-bin build(deps): update clap-verbosity-flag requirement from 2.2 to 3.0 (#2251) 2024-11-26 15:47:43 +02:00
neqo-common refactor(transport): reuse `now` in qlog wherever available (#2216) 2024-11-14 16:18:24 +02:00
neqo-crypto chore: Bump some dependency versions that changed upstream (#2225) 2024-11-12 16:28:37 +00:00
neqo-http3 chore: Fix clippy `this map_or is redundant` (#2232) 2024-11-18 10:04:29 +00:00
neqo-qpack chore: Fix clippy `this map_or is redundant` (#2232) 2024-11-18 10:04:29 +00:00
neqo-transport feat: Shuffle the client Initial crypto data (#2228) 2024-11-29 07:21:32 +00:00
neqo-udp Use try_send, so the caller can handle the IO error (#2237) 2024-11-19 06:55:51 +00:00
qns build(deps): bump lukemathwalker/cargo-chef in /qns (#2250) 2024-11-25 10:36:54 +02:00
taskcluster build(deps): bump alpine in /taskcluster/docker/linux (#2233) 2024-11-18 14:52:31 +02:00
test feat: Shuffle the client Initial crypto data (#2228) 2024-11-29 07:21:32 +00:00
test-fixture chore: Fix clippy `this map_or is redundant` (#2232) 2024-11-18 10:04:29 +00:00
.clippy.toml chore: Declutter, `clippy.toml` -> `.clippy.toml` (#1654) 2024-02-14 12:00:48 +02:00
.codecov.yml test: Experiment with `cargo fuzz` (#1764) 2024-04-18 11:51:25 +03:00
.dockerignore chore: Fix various QNS issues (#1799) 2024-04-09 08:49:51 +03:00
.gitattributes Add EOL rules 2019-03-08 11:39:51 +11:00
.gitignore chore: check-in Cargo.lock (#2208) 2024-11-25 11:17:41 +00:00
.pre-commit-config.yaml fix: Disable pylint pre-commit check (#1958) 2024-07-03 18:42:46 +03:00
.rustfmt.toml fix(.rustfmt.toml): specify Rust edition 2021 (#1722) 2024-03-08 08:08:47 +00:00
.taskcluster.yml.disabled ci: Disable taskcluster again (#1949) 2024-07-02 10:12:37 +03:00
CODE_OF_CONDUCT.md chore: Fix various issues that markdownlint found (#2066) 2024-08-22 09:46:53 +00:00
Cargo.lock chore: prepare v0.11.0 (#2239) 2024-11-27 20:20:48 +00:00
Cargo.toml chore: prepare v0.11.0 (#2239) 2024-11-27 20:20:48 +00:00
LICENSE-APACHE License as dual Apache2/MIT 2019-04-02 16:16:19 -07:00
LICENSE-MIT License as dual Apache2/MIT 2019-04-02 16:16:19 -07:00
README.md docs(README): add neqo-{bin,udp} to Cargo.toml patch section (#2197) 2024-10-25 08:22:05 +03:00
SECURITY.md Create a security policy (#1573) 2024-01-25 09:43:49 +11:00
neqo.png Add logos 2019-08-20 14:58:29 +10:00
neqo.svg Add logos 2019-08-20 14:58:29 +10:00

README.md

Neqo, an Implementation of QUIC in Rust

neqo logo

To build Neqo:

cargo build

This will use a system-installed NSS library if it is new enough. (See "Build with Separate NSS/NSPR" below if NSS is not installed or it is deemed too old.)

To run test HTTP/3 programs (neqo-client and neqo-server):

./target/debug/neqo-server '[::]:12345'
./target/debug/neqo-client 'https://[::]:12345/'

Build with separate NSS/NSPR

You can clone NSS and NSPR into the same directory and export an environment variable called NSS_DIR pointing to NSS. This causes the build to use the existing NSS checkout. However, in order to run anything that depends on NSS, you need to set an environment as follows:

Linux

export LD_LIBRARY_PATH="$(dirname "$(find . -name libssl3.so -print | head -1)")"

macOS

export DYLD_LIBRARY_PATH="$(dirname "$(find . -name libssl3.dylib -print | head -1)")"

Note: If you did not already compile NSS separately, you need to have Mercurial (hg), installed. NSS builds require GYP and Ninja to be installed.

Debugging Neqo

QUIC logging

Enable generation of QLOG logs with:

target/debug/neqo-server '[::]:12345' --qlog-dir .
target/debug/neqo-client 'https://[::]:12345/' --qlog-dir .

You can of course specify a different directory for the QLOG files. You can upload QLOG files to qvis to visualize the flows.

Using SSLKEYLOGFILE to decrypt Wireshark logs

You can export TLS keys by setting the SSLKEYLOGFILE environment variable to a filename to instruct NSS to dump keys in the standard format to enable decryption by Wireshark and other tools.

Using RUST_LOG effectively

As documented in the env_logger documentation, the RUST_LOG environment variable can be used to selectively enable log messages from Rust code. This works for Neqo's command line tools, as well as for when Neqo is incorporated into Gecko, although Gecko needs to be built in debug mode.

Some examples:

  1. RUST_LOG=neqo_transport::dump ./mach run
    

    lists sent and received QUIC packets and their frames' contents only.

  2. RUST_LOG=neqo_transport=debug,neqo_http3=trace,info ./mach run
    

    sets a debug log level for transport, trace level for http3, and info log level for all other Rust crates, both Neqo and others used by Gecko.

  3. RUST_LOG=neqo=trace,error ./mach run
    

    sets trace level for all modules starting with neqo, and sets error as minimum log level for other unrelated Rust log messages.

Trying in-development Neqo code in Gecko

In a checked-out copy of Gecko source, set [patches.*] values for the four Neqo crates to local versions in the root Cargo.toml. For example, if Neqo was checked out to /home/alice/git/neqo, add the following lines to the root Cargo.toml.

[patch."https://github.com/mozilla/neqo"]
neqo-bin = { path = "/home/alice/git/neqo/neqo-bin" }
neqo-common = { path = "/home/alice/git/neqo/neqo-common" }
neqo-crypto = { path = "/home/alice/git/neqo/neqo-crypto" }
neqo-http3 = { path = "/home/alice/git/neqo/neqo-http3" }
neqo-qpack = { path = "/home/alice/git/neqo/neqo-qpack" }
neqo-transport = { path = "/home/alice/git/neqo/neqo-transport" }
neqo-udp = { path = "/home/alice/git/neqo/neqo-udp" }

Then run the following:

./mach vendor rust

Compile Gecko as usual with

./mach build

Note: Using newer Neqo code with Gecko may also require changes (likely to neqo_glue) if something has changed.

Connect with Firefox to local neqo-server

  1. Run neqo-server via cargo run --bin neqo-server -- 'localhost:12345' --db ./test-fixture/db.
  2. On Firefox, set about:config preference network.http.http3.alt-svc-mapping-for-testing to localhost;h3=":12345".
  3. Optionally enable logging via about:logging or profiling via https://profiler.firefox.com/.
  4. Navigate to https://localhost:12345 and accept self-signed certificate.