letify 3.0.2__tar.gz → 3.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {letify-3.0.2 → letify-3.0.4}/PKG-INFO +2 -2
- {letify-3.0.2 → letify-3.0.4}/README.md +1 -1
- {letify-3.0.2 → letify-3.0.4}/docs/SPEC.md +3 -2
- {letify-3.0.2 → letify-3.0.4}/docs/guide/02-providers.md +1 -1
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md +1 -1
- {letify-3.0.2 → letify-3.0.4}/docs/locales/README_ko.md +1 -1
- {letify-3.0.2 → letify-3.0.4}/letify/__init__.py +1 -1
- {letify-3.0.2 → letify-3.0.4}/letify/providers/base.py +29 -7
- {letify-3.0.2 → letify-3.0.4}/letify-core/Cargo.lock +2 -2
- {letify-3.0.2 → letify-3.0.4}/letify-core/Cargo.toml +1 -1
- letify-3.0.4/letify-core/letify-link/examples/udp_rate.rs +309 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/udp.rs +35 -3
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/udp.rs +61 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/package-lock.json +2 -2
- {letify-3.0.2 → letify-3.0.4}/letify-ext/package.json +1 -1
- {letify-3.0.2 → letify-3.0.4}/pyproject.toml +1 -1
- {letify-3.0.2 → letify-3.0.4}/tests/test_tailcat_removed.py +31 -5
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/ci.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/docs.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/letify-link.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/publish-crates.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/publish.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.github/workflows/reserve-crates.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/.gitignore +0 -0
- {letify-3.0.2 → letify-3.0.4}/.researchtree +0 -0
- {letify-3.0.2 → letify-3.0.4}/CLAUDE.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/LICENSE +0 -0
- {letify-3.0.2 → letify-3.0.4}/PROJECT.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/COMPONENT.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/INTENT.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/NETWORK.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/ROADMAP-3.0.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/01-getting-started.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/03-execution-modes.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/04-environments-and-data.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/05-concurrency.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/06-cost.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/07-troubleshooting.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/08-releasing.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/09-agent.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/09-/354/227/220/354/235/264/354/240/204/355/212/270.md" +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/guide/ko/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/docs/mkdocs.yml +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/.letify.example +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/00_smoke.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/01_sweep.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/02_resume.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/03_watch.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/README_ko.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/common.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/examples/nvfp4-lora/recipe.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/cli.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/inventory.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/login.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/schema.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/secrets.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/config/writer.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/cache.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/env.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/exit.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/function.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/instance.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/reduce.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/declare/replicas.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/errors.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/install.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/launcher.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/paths.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/codec.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/driver.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/handle.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/wire.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/protocol/worker.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/colab.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/colab_files.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/colab_keepalive.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/elice.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/kaggle.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/kaggle_adapter.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/local.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/modal.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/modal_adapter.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/naming.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/shell.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/tunnel.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/providers/usage.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/client.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/cuda.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/executor.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/frames.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/guard.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/tensor.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/trace.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/remoting/device/value.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/render.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/bootstrap.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/broker.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/channel.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/control.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/lease.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/pool.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/reattach.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/session.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/takeover.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/telemetry.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/runtime/workers.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/drive.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/filesystem.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/google_auth.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/layout.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/backends/objects.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/cas.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/handoff.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/pathdata.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/sendorder.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/store/volume.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/stubs.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/tools.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/__init__.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/announce.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/link.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkagent.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkchannel.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkd.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkmailbox.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkpump.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkshim.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linksignal.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkupload.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/linkwebsocket.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/nat.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/pipeline.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/portmap.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/probe.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/rendezvous.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/sshopts.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/transport/strategies.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify/useragent.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/.gitignore +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/build.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify/Cargo.toml +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify/LICENSE +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify/src/lib.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/Cargo.toml +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/examples/bench.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/acceptor.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/bin/letify-link.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/config.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/error.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/frame.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/handshake.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/hysteresis.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/identity.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/keys.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/lib.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/observe.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/paths.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/plan.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/policing.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/punch.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/record.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/relay.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/rendezvous.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/replay.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/session.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/sidecar.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/stream.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/stun.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/tcp.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/src/trace.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/acceptor.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/api.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/common/mod.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/diag_sim.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/fairness.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/gauge.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/handshake.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/hysteresis.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/keepalive.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/mobile.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/nat.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/paths.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/qad.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/rekey.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/relay.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/relay_pairing.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/rendezvous.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/reorder.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/replay.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/resume.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/revoke.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/session.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/sidecar.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/startup.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/subflows.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/trace.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/letify-link/tests/udp_bench.rs +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-core/rust-toolchain.toml +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/.vscodeignore +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/LICENSE +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/media/icon.svg +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/cli.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/extension.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/history.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/model.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/poll.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/src/render.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/test/cli.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/test/manifest.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/test/model.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/test/regressions.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-ext/tsconfig.json +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/README.md +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/cloudflare.config.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/package-lock.json +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/package.json +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/auth.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/ed25519.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/handler.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/index.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/limiter.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/mailbox.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/objects.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/protocol.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/src/storage.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/auth.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/ed25519.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/helpers.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/interop.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/limiter.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/mailbox.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/objects.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/setup.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/test/worker.test.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/tsconfig.json +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify-signal/vitest.config.ts +0 -0
- {letify-3.0.2 → letify-3.0.4}/letify_providers.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/scripts/sync-main.sh +0 -0
- {letify-3.0.2 → letify-3.0.4}/scripts/version.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/conftest.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/fake_kaggle_adapter.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/fake_modal_adapter.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_cli.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_cli_output.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_colab_keepalive.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_config.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_core.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_data.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_data_in_place.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_data_streaming.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_declare.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_device.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_device_compile.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_distributed.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_drive_handoff.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_drive_store.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_editor_sessions.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_elice.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_frames.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_install.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_kaggle.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_kaggle_cookie.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_kaggle_link.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_agent.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_channel.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_command_channel.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_exec.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_log.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_mailbox_close.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_opt_in.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_signal.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_ssh_stream.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_link_upload.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_linkd.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_network_guard.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_notebook.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_parallel_placement.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_paths.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_portmap.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_protocol.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_providers.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_punch_sockets.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_quic_removed.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_remoting.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_render.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_run_control.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_run_reattach.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_run_takeover.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_runtime.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_shell_workers.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_ship.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_store.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_strategies.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_stubs.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_suite_guards.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_transport.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_tunnel_agent_login.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_tunnel_setup.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_user_agent.py +0 -0
- {letify-3.0.2 → letify-3.0.4}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: letify
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.4
|
|
4
4
|
Summary: Declarations that become infrastructure.
|
|
5
5
|
Project-URL: Homepage, https://github.com/DarkPyonix/letify
|
|
6
6
|
Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
|
|
@@ -328,7 +328,7 @@ A Kaggle declaration must say `host=letify.remote`. That kernel channel is the o
|
|
|
328
328
|
2. TCP hole punching, for two machines that are both behind NAT
|
|
329
329
|
3. The provider's own path, such as `colab exec` and the Colab file API
|
|
330
330
|
|
|
331
|
-
A lower number wins unless it is far slower than the fastest one that connected. The winner is remembered per account and per network, so the next connection starts with it. A machine behind NAT needs letify installed and `letify agent serve` run on it once, so letify can reach it, with no SSH server. Tailcat is removed, and
|
|
331
|
+
A lower number wins unless it is far slower than the fastest one that connected. The winner is remembered per account and per network, so the next connection starts with it. A machine behind NAT needs letify installed and `letify agent serve` run on it once, so letify can reach it, with no SSH server. Tailcat is removed, and a tunnel account that names `tailcat` is refused with the steps to move it to `letify agent serve`, any other kind that names it is told to delete the field, and `tailcat_binary` is ignored with a one-line notice. When a machine's SSH server is published to the outside under another port, such as Docker's `-p 30501:8022`, `letify login tunnel <alias> --address <host> --public-port 30501` records it: SSH straight to the address then dials port 30501, while hole punching keeps using 8022. Colab and Elice never need an agent: their provider layer creates and opens the machine through the provider's own API. Modal is reached through its own API and is not part of this.
|
|
332
332
|
|
|
333
333
|
**Multiple accounts are first class.** Each configuration entry is one account, and entries of the same kind coexist. Two Colab accounts means twice the concurrent sessions.
|
|
334
334
|
|
|
@@ -303,7 +303,7 @@ A Kaggle declaration must say `host=letify.remote`. That kernel channel is the o
|
|
|
303
303
|
2. TCP hole punching, for two machines that are both behind NAT
|
|
304
304
|
3. The provider's own path, such as `colab exec` and the Colab file API
|
|
305
305
|
|
|
306
|
-
A lower number wins unless it is far slower than the fastest one that connected. The winner is remembered per account and per network, so the next connection starts with it. A machine behind NAT needs letify installed and `letify agent serve` run on it once, so letify can reach it, with no SSH server. Tailcat is removed, and
|
|
306
|
+
A lower number wins unless it is far slower than the fastest one that connected. The winner is remembered per account and per network, so the next connection starts with it. A machine behind NAT needs letify installed and `letify agent serve` run on it once, so letify can reach it, with no SSH server. Tailcat is removed, and a tunnel account that names `tailcat` is refused with the steps to move it to `letify agent serve`, any other kind that names it is told to delete the field, and `tailcat_binary` is ignored with a one-line notice. When a machine's SSH server is published to the outside under another port, such as Docker's `-p 30501:8022`, `letify login tunnel <alias> --address <host> --public-port 30501` records it: SSH straight to the address then dials port 30501, while hole punching keeps using 8022. Colab and Elice never need an agent: their provider layer creates and opens the machine through the provider's own API. Modal is reached through its own API and is not part of this.
|
|
307
307
|
|
|
308
308
|
**Multiple accounts are first class.** Each configuration entry is one account, and entries of the same kind coexist. Two Colab accounts means twice the concurrent sessions.
|
|
309
309
|
|
|
@@ -1854,7 +1854,7 @@ Forward SSH is first because it needs no remote agent and costs one connection a
|
|
|
1854
1854
|
|
|
1855
1855
|
A strategy whose needs are not met is skipped, not attempted. A `Shell` with no rendezvous has only rank 1. Only a provider that can run a program on the machine has a rendezvous: `Colab`, `Kaggle` and `Elice`. A plain `Shell` has none, so it has forward SSH and nothing else, and a machine behind NAT is a `Tunnel` account with an agent, which is reached through letify-link and races no strategy ([Agent and pairing](#link-agent)). The connect back and TCP punch strategies stay for the providers that have a rendezvous, until letify-link replaces them ([letify-link as the default](#link-default)). An account with no `address` has no rank 1: forward SSH is skipped with the reason `no address`, and no SSH command is built for a guessed or empty address. `letify check` on such an account runs over the strategies that remain.
|
|
1856
1856
|
|
|
1857
|
-
|
|
1857
|
+
An account field that named a Tailcat address to connect to, `tailcat` or `tailcat_port`, is refused when its provider is built, with `ProviderUnavailable` naming the account and the field. On a `tunnel` account the message is `<alias> names 'tailcat', but Tailcat was removed in 3.0. Run 'letify agent serve' on the machine, then 'letify login tunnel <alias> --connect letify-agent2:<token>' with the token it prints.` On any other kind it is `<alias> names 'tailcat', which is obsolete since 3.0. Delete it from <alias> in <config file>`, because those kinds reach their runtime without Tailcat and have no agent to set up. `tailcat_binary` only pointed at, or disabled, a Tailcat binary and so carries no connection intent: on any kind letify ignores it and prints one line per process per alias to stderr saying the field is obsolete since 3.0 and can be deleted from the config file. That is not a fallback, because the field selects nothing in 3.0. No other field of the removed tools is handled: letify 3.0 has no `auto_install` or QUIC account option to migrate.
|
|
1858
1858
|
|
|
1859
1859
|
An account reaches SSH on two ports when the machine publishes its SSH server under another port, such as a Docker container started with `-p 30501:8022`. `port` is the SSH server's port inside the machine, and the remote half of a punch splices its connections to `127.0.0.1:<port>`. `public_port` is the port forward SSH dials at `address`. Forward SSH uses `public_port` when the account sets it, and otherwise `port`, read through `port_command` when that is set. TCP punching always uses `port`.
|
|
1860
1860
|
|
|
@@ -2096,6 +2096,7 @@ TCP carries the networks that pass a simultaneous open, and UDP carries those th
|
|
|
2096
2096
|
5. **Path change.** When the last subflow dies, the session keeps its keys and its unacknowledged frames, waits for the path manager to supply a new path (TCP or UDP), runs a short resume exchange that names the highest sequence number received, and retransmits everything after it. Streams above see a pause, not an error. The resume window is a caller setting, and so is the byte bound on the unacknowledged frames kept for resumption. The library default window is 24 h, for clients that suspend. letify sets the window to its lease, so a session never outlives what the lease allows. When resumption is impossible (the window ended, the buffer bound was exceeded or the peer lost its state), the streams fail with a connection error that tells infrastructure failure from user code failure, as [Channels](#channels) requires. The caller may then open a new session.
|
|
2097
2097
|
6. **UDP paths.** A UDP path is a reliable, ordered byte pipe beneath the session over one punched UDP address pair, and the session uses it as a subflow like a TCP connection. letify-link builds it on quinn: one QUIC connection per UDP path, carrying one bidirectional stream, and that stream is the subflow's transport. quinn supplies loss recovery, pacing and BBR congestion control that a custom ARQ would have to rebuild.
|
|
2098
2098
|
- **No identity in QUIC.** Each end presents a throwaway self-signed certificate and the connecting end accepts any certificate. This is safe because nothing relies on QUIC for identity or secrecy: the subflow preamble and every record on the stream are the session's own, and the Noise session authenticates and encrypts them. A node in the middle that terminates the QUIC connection cannot complete the Noise handshake or forge a record. A listener given a peer address serves only that address and refuses every other source; a listener given none serves any address.
|
|
2099
|
+
- **Presenting as HTTP/3.** The ALPN and the server name of the QUIC handshake are `UdpConfig` settings, `alpn` and `server_name`. The defaults are the ALPN `letify-link/udp/1` and the server name `letify`. A middlebox can derive the keys of a QUIC Initial packet from its destination connection id and read both fields, so a path that must look like web traffic sets `alpn = "h3"` and a host name a CDN serves, for example `cdnjs.cloudflare.com`. Both ends must use the same `alpn`, because the handshake is refused when they differ; the `server_name` is read by neither end, so it need not agree. `UdpPath::handshake()` returns the negotiated ALPN and the server name the listener saw. Nothing above changes: the stream still opens with the 4 byte magic and the Noise session still authenticates and encrypts every byte. The path remains a single QUIC stream and does not speak HTTP/3 frames, so the option changes what the handshake presents and nothing else. The option is not exposed as a letify setting.
|
|
2099
2100
|
- **Congestion control and windows.** BBR. The windows are sized for 200 ms x 50 MiB/s, a bandwidth delay product of 10 MiB: the stream and connection receive windows are 16 MiB and the send window is 16 MiB, so one path can fill that rate at that round trip. The UDP socket asks for 8 MiB of send and of receive buffer, and the kernel may grant less.
|
|
2100
2101
|
- **Death.** A UDP path is dead when its QUIC connection closes or has been idle for 30 s (a caller setting). QUIC sends a keep-alive every 10 s, so an idle path stays up when the session's own keepalive is off.
|
|
2101
2102
|
- **Head of line.** A UDP path carries one stream, so a lost datagram holds the later bytes of that path until QUIC recovers it, as a lost TCP segment holds the later bytes of a TCP subflow. The M2 measurement compares four TCP subflows with one UDP path under loss.
|
|
@@ -2279,7 +2280,7 @@ Hypothesis: one long-running process holding a list of paired node ids carries a
|
|
|
2279
2280
|
11. **Connect.** A `tunnel` account with an `agent` field is reached through the agent, with no ssh. The account is a letify-link account without a `link` option: `link = "ssh"` on it is refused by name, because there is no ssh server to reach. It has no address, so `Tunnel.address` is `None` and no strategy is raced. `Tunnel.link()` returns the session's measurements with no ssh command, as `Colab.link()` does. `connect_link` calls `linkchannel.connect_signal`, which opens the sidecar of the account's `link.key`, builds a `SignalClient` for the account's `signal` URL and a `SignalBootstrap` for the node `agent`, and calls `connect_over` with no address, `punch=True`, the channel named `the signalling service` and no binary preparation, because the agent holds the binary of its own machine. The ping of `SignalBootstrap.start` is the bootstrap round trip, so `lead_ms` and the shim wait follow the rules of [Sidecar interface](#link-sidecar) item 8. A failure raises `ProviderUnavailable` with the reason and falls back to nothing.
|
|
2280
2281
|
12. **The ssh target.** `letify agent serve --ssh-target HOST:PORT`, or `ssh_target` in `~/.letify/agent/config.toml`, sets the sshd that the ssh stream of [Sidecar interface](#link-sidecar) item 11 reaches on this machine. It defaults to `127.0.0.1:22`. The agent has no ssh server of its own, so the stream is useful only on a machine that runs one; without one the stream is closed and nothing else is affected.
|
|
2281
2282
|
13. **What needed ssh.** Every step of a login that used ssh has a session equivalent on an agent account: the workspace check and the device query of `letify login tunnel` run over the `exec` stream (Tunnel login section), `letify login tunnel <alias> --detect-devices` asks an agent account again over the same stream and then follows [Recording devices at login](#login-records-devices) item 7, and `Tunnel.check`, the device listing and the worker listing already run over it. There is no key install or key confirmation, because the session authenticates with node keys. An agent account's `--detect-devices` is no longer refused for having no address.
|
|
2282
|
-
14. **Tailcat
|
|
2283
|
+
14. **Tailcat fields.** A `tunnel` account that names `tailcat` or `tailcat_port` is refused when its provider is built, as [Connection strategies](#connection-strategies) says: the error names the account and the field, says Tailcat was removed in 3.0 and gives the migration, `letify agent serve` on the machine and then `letify login tunnel <alias> --connect letify-agent2:<token>`. The same fields on any other account kind are refused with the obsolete-since-3.0 text and no agent migration. `tailcat_binary` on any kind is ignored with a one-line notice.
|
|
2283
2284
|
|
|
2284
2285
|
#### NAT traversal <!-- id: link-nat -->
|
|
2285
2286
|
|
|
@@ -191,7 +191,7 @@ signal = "https://letify.darkpyonix.dev"
|
|
|
191
191
|
|
|
192
192
|
### A Tailcat account
|
|
193
193
|
|
|
194
|
-
Tailcat was removed in 3.0. An account that names `tailcat
|
|
194
|
+
Tailcat was removed in 3.0. An account that names `tailcat` or `tailcat_port` is refused, and the message names the account and the field. On a `tunnel` account the message gives the migration, and on any other kind it says the field is obsolete since 3.0 and to delete it from the config file. `tailcat_binary` is ignored on every kind, with one line printed per alias saying it can be deleted. To migrate a tunnel account, run `letify agent serve` on the machine and run `letify login tunnel home_box --connect letify-agent2:...` with the token it prints. Use `--replace` to renew an account that is already declared.
|
|
195
195
|
|
|
196
196
|
Try the simpler paths first. A direct address, then a jump host, then this. Campus machines often allow one of the first two. Details and measurements are in [docs/NETWORK.md](../NETWORK.md).
|
|
197
197
|
|
|
@@ -191,7 +191,7 @@ signal = "https://letify.darkpyonix.dev"
|
|
|
191
191
|
|
|
192
192
|
### Tailcat 계정
|
|
193
193
|
|
|
194
|
-
Tailcat은 3.0에서 제거되었습니다. `tailcat`, `tailcat_port
|
|
194
|
+
Tailcat은 3.0에서 제거되었습니다. `tailcat`, `tailcat_port`를 적은 계정은 거부되고, 메시지에 계정과 필드 이름이 나옵니다. `tunnel` 계정에는 옮기는 방법이 나오고, 다른 종류의 계정에는 3.0부터 쓰지 않는 필드이니 설정 파일에서 지우라는 안내가 나옵니다. `tailcat_binary`는 모든 종류에서 무시되며, 계정마다 지워도 된다는 한 줄만 출력됩니다. tunnel 계정을 옮기려면 머신에서 `letify agent serve`를 실행하고, 출력된 토큰으로 `letify login tunnel home_box --connect letify-agent2:...`를 실행하세요. 이미 선언된 계정을 갱신하려면 `--replace`를 붙입니다.
|
|
195
195
|
|
|
196
196
|
더 단순한 경로를 먼저 시도하세요. 직접 주소, 그다음 점프 호스트, 그다음 터널입니다. 학교 머신은 앞의 두 개가 되는 경우가 많습니다. 상세한 측정치는 [docs/NETWORK.md](../../NETWORK.md)에 있습니다.
|
|
197
197
|
|
|
@@ -297,7 +297,7 @@ Kaggle 선언에는 `host=letify.remote`를 써야 합니다. Kaggle은 인바
|
|
|
297
297
|
2. TCP 홀펀칭, 양쪽이 모두 NAT 뒤에 있을 때
|
|
298
298
|
3. 프로바이더 자체 경로, 예를 들어 `colab exec`와 Colab 파일 API
|
|
299
299
|
|
|
300
|
-
번호가 낮은 방법이 이깁니다. 다만 연결된 방법 중 가장 빠른 것보다 훨씬 느리면 탈락합니다. 이긴 방법은 계정과 네트워크별로 기억해 두고, 다음 연결에서 먼저 시도합니다. NAT 뒤에 있는 머신은 letify를 설치한 뒤 그 머신에서 `letify agent serve`를 한 번 실행하면 letify가 접속할 수 있고, SSH 서버가 필요 없습니다. Tailcat은 제거되었고, `tailcat`을 적은 계정은 `letify agent serve`로 옮기는 방법과 함께
|
|
300
|
+
번호가 낮은 방법이 이깁니다. 다만 연결된 방법 중 가장 빠른 것보다 훨씬 느리면 탈락합니다. 이긴 방법은 계정과 네트워크별로 기억해 두고, 다음 연결에서 먼저 시도합니다. NAT 뒤에 있는 머신은 letify를 설치한 뒤 그 머신에서 `letify agent serve`를 한 번 실행하면 letify가 접속할 수 있고, SSH 서버가 필요 없습니다. Tailcat은 제거되었고, `tailcat`을 적은 tunnel 계정은 `letify agent serve`로 옮기는 방법과 함께 거부되고, 다른 종류의 계정은 그 필드를 지우라는 안내와 함께 거부되며, `tailcat_binary`는 한 줄 안내만 출력하고 무시됩니다. 머신의 SSH 서버가 Docker의 `-p 30501:8022`처럼 다른 포트로 외부에 열려 있다면 `letify login tunnel <alias> --address <host> --public-port 30501`로 기록합니다. 그러면 주소로 바로 하는 SSH는 30501 포트로 접속하고, 홀펀칭은 계속 8022를 씁니다. Colab과 Elice는 에이전트가 아예 필요 없습니다. 프로바이더 계층이 각 서비스의 API로 머신을 만들고 엽니다. Modal은 자체 API로 연결하므로 여기에 해당하지 않습니다.
|
|
301
301
|
|
|
302
302
|
**여러 계정을 정식으로 지원합니다.** 설정 항목 하나가 계정 하나이고, 같은 종류를 여러 개 둘 수 있습니다. Colab 계정이 두 개면 동시 세션도 두 배가 됩니다.
|
|
303
303
|
|
|
@@ -26,6 +26,7 @@ from __future__ import annotations
|
|
|
26
26
|
|
|
27
27
|
import abc
|
|
28
28
|
import dataclasses
|
|
29
|
+
import sys
|
|
29
30
|
import threading
|
|
30
31
|
from collections.abc import Iterator, Mapping, Sequence
|
|
31
32
|
from typing import TYPE_CHECKING, Any, Literal
|
|
@@ -40,6 +41,7 @@ from ..errors import (
|
|
|
40
41
|
UnknownInstance,
|
|
41
42
|
UnsupportedMode,
|
|
42
43
|
)
|
|
44
|
+
from ..paths import config_label
|
|
43
45
|
from .usage import Usage, from_command
|
|
44
46
|
|
|
45
47
|
if TYPE_CHECKING:
|
|
@@ -63,9 +65,16 @@ class RuntimeState:
|
|
|
63
65
|
detail: str = ""
|
|
64
66
|
|
|
65
67
|
|
|
66
|
-
#: Account fields
|
|
67
|
-
#: Spec "Connection strategies".
|
|
68
|
-
REMOVED_TAILCAT_FIELDS = ("tailcat", "tailcat_port"
|
|
68
|
+
#: Account fields that named a Tailcat address to connect to. An account that names one is
|
|
69
|
+
#: refused. Spec "Connection strategies".
|
|
70
|
+
REMOVED_TAILCAT_FIELDS = ("tailcat", "tailcat_port")
|
|
71
|
+
|
|
72
|
+
#: The field that only pointed at, or disabled, a Tailcat binary. It selects nothing in 3.0,
|
|
73
|
+
#: so it is ignored with a notice. Spec "Connection strategies".
|
|
74
|
+
OBSOLETE_TAILCAT_FIELD = "tailcat_binary"
|
|
75
|
+
|
|
76
|
+
#: The aliases already told that ``tailcat_binary`` is obsolete, one notice per process.
|
|
77
|
+
_NOTIFIED: set[str] = set()
|
|
69
78
|
|
|
70
79
|
|
|
71
80
|
class Provider(abc.ABC):
|
|
@@ -106,13 +115,26 @@ class Provider(abc.ABC):
|
|
|
106
115
|
def __init__(self, config: ProviderConfig):
|
|
107
116
|
for removed in REMOVED_TAILCAT_FIELDS:
|
|
108
117
|
if removed in config.options:
|
|
118
|
+
if self.kind == "tunnel":
|
|
119
|
+
raise ProviderUnavailable(
|
|
120
|
+
self.kind,
|
|
121
|
+
f"{config.alias} names {removed!r}, but Tailcat was removed in 3.0. "
|
|
122
|
+
f"Run 'letify agent serve' on the machine, then "
|
|
123
|
+
f"'letify login tunnel {config.alias} --connect letify-agent2:<token>' "
|
|
124
|
+
f"with the token it prints",
|
|
125
|
+
)
|
|
109
126
|
raise ProviderUnavailable(
|
|
110
127
|
self.kind,
|
|
111
|
-
f"{config.alias} names {removed!r},
|
|
112
|
-
f"
|
|
113
|
-
f"'letify login tunnel {config.alias} --connect letify-agent2:<token>' "
|
|
114
|
-
f"with the token it prints",
|
|
128
|
+
f"{config.alias} names {removed!r}, which is obsolete since 3.0. Delete "
|
|
129
|
+
f"it from {config.alias} in {config_label()}",
|
|
115
130
|
)
|
|
131
|
+
if OBSOLETE_TAILCAT_FIELD in config.options and config.alias not in _NOTIFIED:
|
|
132
|
+
_NOTIFIED.add(config.alias)
|
|
133
|
+
print(
|
|
134
|
+
f"{config.alias}: {OBSOLETE_TAILCAT_FIELD!r} is obsolete since 3.0 and is "
|
|
135
|
+
f"ignored. Delete it from {config.alias} in {config_label()}",
|
|
136
|
+
file=sys.stderr,
|
|
137
|
+
)
|
|
116
138
|
self.config = config
|
|
117
139
|
self.alias = config.alias
|
|
118
140
|
self._instances: dict[str, Instance] | None = None
|
|
@@ -396,11 +396,11 @@ dependencies = [
|
|
|
396
396
|
|
|
397
397
|
[[package]]
|
|
398
398
|
name = "letify"
|
|
399
|
-
version = "3.0.
|
|
399
|
+
version = "3.0.4"
|
|
400
400
|
|
|
401
401
|
[[package]]
|
|
402
402
|
name = "letify-link"
|
|
403
|
-
version = "3.0.
|
|
403
|
+
version = "3.0.4"
|
|
404
404
|
dependencies = [
|
|
405
405
|
"ed25519-dalek",
|
|
406
406
|
"getrandom 0.2.17",
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
//! Measures what one punched UDP pair delivers in each direction, for three arms: raw paced
|
|
2
|
+
//! datagrams (`raw`), a letify-link UDP path with its default handshake (`quic`), and the same
|
|
3
|
+
//! path presenting as HTTP/3 (`h3`). It is a measurement tool for the experiment branch
|
|
4
|
+
//! `feat/link-udp-h3`, not part of the product.
|
|
5
|
+
//!
|
|
6
|
+
//! The two ends are the same program. Each binds a UDP socket, learns its public mapping from
|
|
7
|
+
//! STUN and writes it to `<dir>/map.txt`, then waits for `<dir>/peer.txt`, which holds
|
|
8
|
+
//! `<peer ip:port> <start unix ms>`. Both punch from that start time, run the arm in phase 1
|
|
9
|
+
//! (the `init` role sends) and phase 2 (the `resp` role sends), and write `<dir>/result.json`.
|
|
10
|
+
//!
|
|
11
|
+
//! Run with `cargo run --release -p letify-link --example udp_rate -- <arm> <init|resp> <dir>`.
|
|
12
|
+
|
|
13
|
+
use std::net::SocketAddr;
|
|
14
|
+
use std::path::{Path, PathBuf};
|
|
15
|
+
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
|
16
|
+
|
|
17
|
+
use letify_link::punch::{Plan, punch_udp, punch_udp_all};
|
|
18
|
+
use letify_link::stun;
|
|
19
|
+
use letify_link::udp::{UdpConfig, UdpListener, UdpPath};
|
|
20
|
+
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
|
21
|
+
use tokio::net::UdpSocket;
|
|
22
|
+
use tokio::time::{Instant, sleep, sleep_until, timeout, timeout_at};
|
|
23
|
+
|
|
24
|
+
const TOKEN: [u8; 16] = *b"udp-rate-token-1";
|
|
25
|
+
const PUNCH_MS: u64 = 10_000;
|
|
26
|
+
const PING_MS: u64 = 3_000;
|
|
27
|
+
const WINDOW_S: u64 = 6;
|
|
28
|
+
const GAP_S: u64 = 2;
|
|
29
|
+
const PACKET: usize = 1200;
|
|
30
|
+
|
|
31
|
+
fn now_ms() -> u64 {
|
|
32
|
+
SystemTime::now()
|
|
33
|
+
.duration_since(UNIX_EPOCH)
|
|
34
|
+
.unwrap()
|
|
35
|
+
.as_millis() as u64
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// The instant at which the unix time `ms` occurs.
|
|
39
|
+
fn at(ms: u64) -> Instant {
|
|
40
|
+
let now = now_ms();
|
|
41
|
+
if ms > now {
|
|
42
|
+
Instant::now() + Duration::from_millis(ms - now)
|
|
43
|
+
} else {
|
|
44
|
+
Instant::now()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fn config(arm: &str) -> UdpConfig {
|
|
49
|
+
match arm {
|
|
50
|
+
"h3" => UdpConfig {
|
|
51
|
+
alpn: b"h3".to_vec(),
|
|
52
|
+
server_name: "cdnjs.cloudflare.com".into(),
|
|
53
|
+
..UdpConfig::default()
|
|
54
|
+
},
|
|
55
|
+
_ => UdpConfig::default(),
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/// Bytes received in each second of a phase.
|
|
60
|
+
struct Series {
|
|
61
|
+
per_second: Vec<u64>,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
impl Series {
|
|
65
|
+
fn new() -> Self {
|
|
66
|
+
Series {
|
|
67
|
+
per_second: vec![0; WINDOW_S as usize + 1],
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
fn add(&mut self, start: Instant, bytes: usize) {
|
|
72
|
+
let s = Instant::now().saturating_duration_since(start).as_secs() as usize;
|
|
73
|
+
if let Some(slot) = self.per_second.get_mut(s) {
|
|
74
|
+
*slot += bytes as u64;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
fn json(&self) -> String {
|
|
79
|
+
let list: Vec<String> = self.per_second.iter().map(|b| b.to_string()).collect();
|
|
80
|
+
format!("[{}]", list.join(","))
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// Receive datagrams tagged `RAW1` until `end`.
|
|
85
|
+
async fn raw_receive(socket: &UdpSocket, start: Instant, end: Instant) -> (Series, u64, u64) {
|
|
86
|
+
let mut series = Series::new();
|
|
87
|
+
let (mut packets, mut highest) = (0u64, 0u64);
|
|
88
|
+
let mut buf = vec![0u8; 2048];
|
|
89
|
+
while let Ok(Ok(n)) = timeout_at(end, socket.recv(&mut buf)).await {
|
|
90
|
+
if n >= 12 && &buf[..4] == b"RAW1" {
|
|
91
|
+
series.add(start, n);
|
|
92
|
+
packets += 1;
|
|
93
|
+
highest = highest.max(u64::from_le_bytes(buf[4..12].try_into().unwrap()) + 1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
(series, packets, highest)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// Send `PACKET` byte datagrams at `rate` bytes a second until `end`. Returns the count sent.
|
|
100
|
+
async fn raw_send(socket: &UdpSocket, rate: f64, start: Instant, end: Instant) -> u64 {
|
|
101
|
+
let mut buf = vec![0u8; PACKET];
|
|
102
|
+
buf[..4].copy_from_slice(b"RAW1");
|
|
103
|
+
let mut sent = 0u64;
|
|
104
|
+
while Instant::now() < end {
|
|
105
|
+
let due = (start.elapsed().as_secs_f64() * rate / PACKET as f64) as u64;
|
|
106
|
+
let mut burst = 0;
|
|
107
|
+
while sent < due && burst < 64 {
|
|
108
|
+
buf[4..12].copy_from_slice(&sent.to_le_bytes());
|
|
109
|
+
let _ = socket.send(&buf).await;
|
|
110
|
+
sent += 1;
|
|
111
|
+
burst += 1;
|
|
112
|
+
}
|
|
113
|
+
sleep(Duration::from_millis(1)).await;
|
|
114
|
+
}
|
|
115
|
+
sent
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async fn raw_arm(
|
|
119
|
+
socket: UdpSocket,
|
|
120
|
+
init: bool,
|
|
121
|
+
peer: SocketAddr,
|
|
122
|
+
ts: u64,
|
|
123
|
+
rate: f64,
|
|
124
|
+
) -> Vec<String> {
|
|
125
|
+
socket.connect(peer).await.unwrap();
|
|
126
|
+
let mut out = Vec::new();
|
|
127
|
+
// Round trip: the initiator pings, the responder echoes.
|
|
128
|
+
let ping_end = at(ts + PING_MS);
|
|
129
|
+
let mut rtts = Vec::new();
|
|
130
|
+
sleep_until(at(ts)).await;
|
|
131
|
+
let mut buf = vec![0u8; 2048];
|
|
132
|
+
if init {
|
|
133
|
+
let mut n = 0u64;
|
|
134
|
+
while Instant::now() < ping_end {
|
|
135
|
+
let sent = Instant::now();
|
|
136
|
+
let mut msg = b"PING".to_vec();
|
|
137
|
+
msg.extend_from_slice(&n.to_le_bytes());
|
|
138
|
+
let _ = socket.send(&msg).await;
|
|
139
|
+
if let Ok(Ok(k)) = timeout(Duration::from_millis(500), socket.recv(&mut buf)).await
|
|
140
|
+
&& &buf[..4] == b"PONG"
|
|
141
|
+
&& k == msg.len()
|
|
142
|
+
{
|
|
143
|
+
rtts.push(sent.elapsed().as_secs_f64() * 1000.0);
|
|
144
|
+
}
|
|
145
|
+
n += 1;
|
|
146
|
+
sleep(Duration::from_millis(100)).await;
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
while let Ok(Ok(n)) = timeout_at(ping_end, socket.recv(&mut buf)).await {
|
|
150
|
+
if &buf[..4] == b"PING" {
|
|
151
|
+
let mut reply = buf[..n].to_vec();
|
|
152
|
+
reply[..4].copy_from_slice(b"PONG");
|
|
153
|
+
let _ = socket.send(&reply).await;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
rtts.sort_by(|a, b| a.partial_cmp(b).unwrap());
|
|
158
|
+
out.push(format!(
|
|
159
|
+
"\"rtt_ms_median\":{:.1},\"rtt_samples\":{}",
|
|
160
|
+
rtts.get(rtts.len() / 2).copied().unwrap_or(-1.0),
|
|
161
|
+
rtts.len()
|
|
162
|
+
));
|
|
163
|
+
let t1 = ts + PING_MS + 1000;
|
|
164
|
+
let t2 = t1 + (WINDOW_S + GAP_S) * 1000;
|
|
165
|
+
for (phase, start_ms) in [(1, t1), (2, t2)] {
|
|
166
|
+
let start = at(start_ms);
|
|
167
|
+
sleep_until(start).await;
|
|
168
|
+
let end = at(start_ms + WINDOW_S * 1000);
|
|
169
|
+
let sends = (phase == 1) == init;
|
|
170
|
+
if sends {
|
|
171
|
+
let sent = raw_send(&socket, rate, start, end).await;
|
|
172
|
+
out.push(format!("\"phase{phase}_sent_packets\":{sent}"));
|
|
173
|
+
} else {
|
|
174
|
+
let tail = at(start_ms + WINDOW_S * 1000 + 800);
|
|
175
|
+
let (series, packets, highest) = raw_receive(&socket, start, tail).await;
|
|
176
|
+
out.push(format!(
|
|
177
|
+
"\"phase{phase}_recv_bytes_per_second\":{},\"phase{phase}_recv_packets\":{packets},\"phase{phase}_highest_seq\":{highest}",
|
|
178
|
+
series.json()
|
|
179
|
+
));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
out
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async fn quic_arm(mut path: UdpPath, init: bool, ts: u64) -> Vec<String> {
|
|
186
|
+
let mut out = Vec::new();
|
|
187
|
+
let seen = path.handshake();
|
|
188
|
+
out.push(format!(
|
|
189
|
+
"\"alpn\":\"{}\",\"server_name\":\"{}\"",
|
|
190
|
+
String::from_utf8_lossy(seen.alpn.as_deref().unwrap_or(b"")),
|
|
191
|
+
seen.server_name.unwrap_or_default()
|
|
192
|
+
));
|
|
193
|
+
let t1 = ts + PING_MS + 1000;
|
|
194
|
+
let t2 = t1 + (WINDOW_S + GAP_S) * 1000;
|
|
195
|
+
let chunk = vec![0x5au8; 256 << 10];
|
|
196
|
+
for (phase, start_ms) in [(1, t1), (2, t2)] {
|
|
197
|
+
let start = at(start_ms);
|
|
198
|
+
sleep_until(start).await;
|
|
199
|
+
let end = at(start_ms + WINDOW_S * 1000);
|
|
200
|
+
if (phase == 1) == init {
|
|
201
|
+
let mut sent = 0u64;
|
|
202
|
+
while Instant::now() < end {
|
|
203
|
+
match timeout_at(end, path.write_all(&chunk)).await {
|
|
204
|
+
Ok(Ok(())) => sent += chunk.len() as u64,
|
|
205
|
+
_ => break,
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
out.push(format!("\"phase{phase}_written_bytes\":{sent}"));
|
|
209
|
+
} else {
|
|
210
|
+
let mut series = Series::new();
|
|
211
|
+
let mut buf = vec![0u8; 1 << 20];
|
|
212
|
+
let tail = at(start_ms + WINDOW_S * 1000 + 800);
|
|
213
|
+
while let Ok(Ok(n)) = timeout_at(tail, path.read(&mut buf)).await {
|
|
214
|
+
if n == 0 {
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
series.add(start, n);
|
|
218
|
+
}
|
|
219
|
+
out.push(format!(
|
|
220
|
+
"\"phase{phase}_recv_bytes_per_second\":{}",
|
|
221
|
+
series.json()
|
|
222
|
+
));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// Keep the path open until the peer's last phase has drained.
|
|
226
|
+
sleep(Duration::from_millis(500)).await;
|
|
227
|
+
out
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async fn run(arm: &str, init: bool, dir: &Path, rate: f64) -> Result<Vec<String>, String> {
|
|
231
|
+
let err = |e: std::io::Error| e.to_string();
|
|
232
|
+
let socket = UdpSocket::bind("0.0.0.0:0").await.map_err(err)?;
|
|
233
|
+
let servers = stun::resolve(&stun::DEFAULT_SERVERS).await;
|
|
234
|
+
let server = *servers.first().ok_or("no STUN server resolved")?;
|
|
235
|
+
let mapped = stun::binding(&socket, server, Duration::from_secs(3))
|
|
236
|
+
.await
|
|
237
|
+
.map_err(err)?;
|
|
238
|
+
std::fs::write(dir.join("map.txt"), mapped.to_string()).map_err(err)?;
|
|
239
|
+
let peer_file = dir.join("peer.txt");
|
|
240
|
+
let waited = Instant::now();
|
|
241
|
+
let text = loop {
|
|
242
|
+
if let Ok(t) = std::fs::read_to_string(&peer_file)
|
|
243
|
+
&& t.trim().split(' ').count() == 2
|
|
244
|
+
{
|
|
245
|
+
break t;
|
|
246
|
+
}
|
|
247
|
+
if waited.elapsed() > Duration::from_secs(120) {
|
|
248
|
+
return Err("no peer.txt".into());
|
|
249
|
+
}
|
|
250
|
+
sleep(Duration::from_millis(100)).await;
|
|
251
|
+
};
|
|
252
|
+
let mut parts = text.trim().split(' ');
|
|
253
|
+
let peer: SocketAddr = parts.next().unwrap().parse().map_err(|_| "bad peer")?;
|
|
254
|
+
let t0: u64 = parts.next().unwrap().parse().map_err(|_| "bad start")?;
|
|
255
|
+
let plan = Plan {
|
|
256
|
+
start_at_ms: t0,
|
|
257
|
+
until_ms: t0 + PUNCH_MS,
|
|
258
|
+
};
|
|
259
|
+
let ts = t0 + PUNCH_MS + 1500;
|
|
260
|
+
let cfg = config(arm);
|
|
261
|
+
let mut out = vec![format!("\"mapped\":\"{mapped}\",\"peer\":\"{peer}\"")];
|
|
262
|
+
let (socket, from) = if init {
|
|
263
|
+
punch_udp(vec![socket], &[peer], &TOKEN, plan, 200)
|
|
264
|
+
.await
|
|
265
|
+
.map_err(err)?
|
|
266
|
+
} else {
|
|
267
|
+
let (mut all, i, from) = punch_udp_all(vec![socket], &[peer], &TOKEN, plan, 200)
|
|
268
|
+
.await
|
|
269
|
+
.map_err(err)?;
|
|
270
|
+
(all.swap_remove(i), from)
|
|
271
|
+
};
|
|
272
|
+
if arm == "raw" {
|
|
273
|
+
out.extend(raw_arm(socket, init, from, ts, rate).await);
|
|
274
|
+
} else if init {
|
|
275
|
+
let std = socket.into_std().map_err(err)?;
|
|
276
|
+
let path = UdpPath::connect_with(std, from, &cfg).await.map_err(err)?;
|
|
277
|
+
out.extend(quic_arm(path, true, ts).await);
|
|
278
|
+
} else {
|
|
279
|
+
let std = socket.into_std().map_err(err)?;
|
|
280
|
+
let mut listener = UdpListener::new(std, Some(from), &cfg).map_err(err)?;
|
|
281
|
+
let path = timeout(Duration::from_secs(20), listener.accept())
|
|
282
|
+
.await
|
|
283
|
+
.map_err(|_| "no QUIC handshake arrived".to_string())?
|
|
284
|
+
.map_err(err)?;
|
|
285
|
+
out.extend(quic_arm(path, false, ts).await);
|
|
286
|
+
}
|
|
287
|
+
Ok(out)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
#[tokio::main]
|
|
291
|
+
async fn main() {
|
|
292
|
+
let args: Vec<String> = std::env::args().collect();
|
|
293
|
+
if args.len() < 4 {
|
|
294
|
+
eprintln!("usage: udp_rate <raw|quic|h3> <init|resp> <dir> [rate MiB/s]");
|
|
295
|
+
std::process::exit(2);
|
|
296
|
+
}
|
|
297
|
+
let dir = PathBuf::from(&args[3]);
|
|
298
|
+
let rate = args
|
|
299
|
+
.get(4)
|
|
300
|
+
.and_then(|r| r.parse::<f64>().ok())
|
|
301
|
+
.unwrap_or(4.0)
|
|
302
|
+
* 1048576.0;
|
|
303
|
+
let body = match run(&args[1], args[2] == "init", &dir, rate).await {
|
|
304
|
+
Ok(fields) => format!("{{\"arm\":\"{}\",{}}}", args[1], fields.join(",")),
|
|
305
|
+
Err(e) => format!("{{\"arm\":\"{}\",\"error\":{:?}}}", args[1], e),
|
|
306
|
+
};
|
|
307
|
+
let _ = std::fs::write(dir.join("result.json"), body);
|
|
308
|
+
std::process::exit(0);
|
|
309
|
+
}
|
|
@@ -49,6 +49,12 @@ pub struct UdpConfig {
|
|
|
49
49
|
pub keep_alive: Duration,
|
|
50
50
|
/// Time limit for the QUIC handshake and the stream. Default 10 s.
|
|
51
51
|
pub connect_timeout: Duration,
|
|
52
|
+
/// The ALPN protocol both ends offer, and the handshake is refused when they differ.
|
|
53
|
+
/// Default `letify-link/udp/1`. Set `h3` to present the handshake of HTTP/3.
|
|
54
|
+
pub alpn: Vec<u8>,
|
|
55
|
+
/// The server name the connecting end sends. The accepting end does not check it.
|
|
56
|
+
/// Default `letify`. Set a host name a CDN serves to look like web traffic.
|
|
57
|
+
pub server_name: String,
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
impl Default for UdpConfig {
|
|
@@ -60,6 +66,8 @@ impl Default for UdpConfig {
|
|
|
60
66
|
idle_timeout: Duration::from_secs(30),
|
|
61
67
|
keep_alive: Duration::from_secs(10),
|
|
62
68
|
connect_timeout: Duration::from_secs(10),
|
|
69
|
+
alpn: ALPN.to_vec(),
|
|
70
|
+
server_name: "letify".into(),
|
|
63
71
|
}
|
|
64
72
|
}
|
|
65
73
|
}
|
|
@@ -97,7 +105,7 @@ fn server_config(cfg: &UdpConfig) -> io::Result<ServerConfig> {
|
|
|
97
105
|
.with_no_client_auth()
|
|
98
106
|
.with_single_cert(chain, key)
|
|
99
107
|
.map_err(other)?;
|
|
100
|
-
crypto.alpn_protocols = vec![
|
|
108
|
+
crypto.alpn_protocols = vec![cfg.alpn.clone()];
|
|
101
109
|
let mut server =
|
|
102
110
|
ServerConfig::with_crypto(Arc::new(QuicServerConfig::try_from(crypto).map_err(other)?));
|
|
103
111
|
server.transport_config(transport(cfg)?);
|
|
@@ -111,7 +119,7 @@ fn client_config(cfg: &UdpConfig) -> io::Result<ClientConfig> {
|
|
|
111
119
|
.dangerous()
|
|
112
120
|
.with_custom_certificate_verifier(Arc::new(AnyPeer))
|
|
113
121
|
.with_no_client_auth();
|
|
114
|
-
crypto.alpn_protocols = vec![
|
|
122
|
+
crypto.alpn_protocols = vec![cfg.alpn.clone()];
|
|
115
123
|
let mut client =
|
|
116
124
|
ClientConfig::new(Arc::new(QuicClientConfig::try_from(crypto).map_err(other)?));
|
|
117
125
|
client.transport_config(transport(cfg)?);
|
|
@@ -180,6 +188,15 @@ fn endpoint(
|
|
|
180
188
|
)
|
|
181
189
|
}
|
|
182
190
|
|
|
191
|
+
/// What the handshake of a path negotiated.
|
|
192
|
+
#[derive(Clone, Debug, Default, PartialEq, Eq)]
|
|
193
|
+
pub struct Handshake {
|
|
194
|
+
/// The ALPN protocol both ends agreed on.
|
|
195
|
+
pub alpn: Option<Vec<u8>>,
|
|
196
|
+
/// The server name the connecting end sent. Only the accepting end learns it.
|
|
197
|
+
pub server_name: Option<String>,
|
|
198
|
+
}
|
|
199
|
+
|
|
183
200
|
/// One UDP path: a QUIC connection and its one stream, usable as a session subflow.
|
|
184
201
|
pub struct UdpPath {
|
|
185
202
|
send: SendStream,
|
|
@@ -203,7 +220,7 @@ impl UdpPath {
|
|
|
203
220
|
) -> io::Result<UdpPath> {
|
|
204
221
|
let endpoint = endpoint(socket, None, cfg)?;
|
|
205
222
|
let connecting = endpoint
|
|
206
|
-
.connect_with(client_config(cfg)?, peer,
|
|
223
|
+
.connect_with(client_config(cfg)?, peer, &cfg.server_name)
|
|
207
224
|
.map_err(other)?;
|
|
208
225
|
let timeout = || io::Error::new(io::ErrorKind::TimedOut, "the UDP path did not open");
|
|
209
226
|
let conn = tokio::time::timeout(cfg.connect_timeout, connecting)
|
|
@@ -244,6 +261,21 @@ impl UdpPath {
|
|
|
244
261
|
self._endpoint.local_addr()
|
|
245
262
|
}
|
|
246
263
|
|
|
264
|
+
/// The ALPN and server name of the handshake of this path.
|
|
265
|
+
pub fn handshake(&self) -> Handshake {
|
|
266
|
+
let data = self
|
|
267
|
+
.conn
|
|
268
|
+
.handshake_data()
|
|
269
|
+
.and_then(|d| d.downcast::<quinn::crypto::rustls::HandshakeData>().ok());
|
|
270
|
+
match data {
|
|
271
|
+
Some(d) => Handshake {
|
|
272
|
+
alpn: d.protocol.clone(),
|
|
273
|
+
server_name: d.server_name.clone(),
|
|
274
|
+
},
|
|
275
|
+
None => Handshake::default(),
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
247
279
|
/// The address of the peer.
|
|
248
280
|
pub fn peer_addr(&self) -> SocketAddr {
|
|
249
281
|
self.conn.remote_address()
|